$NetBSD: patch-ak,v 1.2 1999/11/26 22:12:38 hubertf Exp $ diff -x *.orig -urN ./icb/unix.c /usr/pkgsrc/net/icb/work.i386.unpatched/icb-5.0.9/icb/unix.c --- ./icb/unix.c Fri Feb 24 22:20:31 1995 +++ /usr/pkgsrc/net/icb/work.i386.unpatched/icb-5.0.9/icb/unix.c Fri Nov 26 22:56:29 1999 @@ -4,6 +4,8 @@ /* This file contains routines that are unix dependent. */ /* Eventually, most unixisms should be moved here. */ +#include +#include #include #include "icb.h" #include "externs.h" @@ -13,6 +15,14 @@ #undef stty #undef gtty +#if defined(__linux__) +#include +#include +#define TTYSTRUCT termios +#define stty(fd,buf) tcgetattr((fd), (buf)) +#define gtty(fd,buf) tcsetattr((fd), TCSANOW, (buf)) +#define SYSV +#else #ifndef SYSV #ifdef linux @@ -30,6 +40,7 @@ #define stty(fd,buf) ioctl((fd),TCSETA,(buf)) #define gtty(fd,buf) ioctl((fd),TCGETA,(buf)) #endif /* SYSV */ +#endif /* __linux__ */ char *getlogin(); @@ -49,8 +60,10 @@ if (((loginid = getlogin()) == NULL) || *loginid == '\0') if ((pw = getpwuid(getuid())) == NULL) loginid = NULL; - else - loginid = pw->pw_name; + else { + loginid = malloc(strlen(pw->pw_name) + 1); + strcpy(loginid, pw->pw_name); + } return(loginid); } @@ -181,7 +194,7 @@ getwinsize() { -#ifndef NOWINSIZE +#ifdef TIOCGWINSZ struct winsize win; /* get tty settings */