From: djm Date: Tue, 29 Aug 2000 23:11:30 +0000 (+0000) Subject: - (djm) NeXT patch from Ben Lindstrom X-Git-Tag: V_2_2_0_P1~6 X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/commitdiff_plain/84a770d1e44d6932d0a46c71510258e6f75be1d9 - (djm) NeXT patch from Ben Lindstrom --- diff --git a/CREDITS b/CREDITS index 4329838c..63a5e940 100644 --- a/CREDITS +++ b/CREDITS @@ -47,6 +47,7 @@ Kevin O'Connor - RSAless operation Kiyokazu SUTO - Bugfixes Lutz Jaenicke - Bugfixes Marc G. Fournier - Solaris patches +Mark Miller - Bugfixes Matt Richards - AIX patches Michael Stone - Irix enhancements Nalin Dahyabhai - PAM environment patch diff --git a/ChangeLog b/ChangeLog index d1bfec9b..fae5c7c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ - (djm) Quieten the pam delete credentials error message - (djm) Fix printing of $DISPLAY hack if set by system type. Report from Kevin Steves + - (djm) NeXT patch from Ben Lindstrom 20000829 - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert diff --git a/configure.in b/configure.in index 5321aedc..d281c7d2 100644 --- a/configure.in +++ b/configure.in @@ -126,7 +126,6 @@ case "$host" in MAIL=/usr/spool/mail AC_DEFINE(HAVE_NEXT) CFLAGS="$CFLAGS -I/usr/local/include" - AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel]) ;; *-*-solaris*) CFLAGS="$CFLAGS -I/usr/local/include" diff --git a/next-posix.c b/next-posix.c index 0f0c0ea4..7bb34ef0 100644 --- a/next-posix.c +++ b/next-posix.c @@ -2,8 +2,36 @@ #ifdef HAVE_NEXT #include +#include #include "next-posix.h" +pid_t +posix_wait(int *status) +{ + #undef wait /* Use NeXT's wait() function */ + union wait statusp; + pid_t wait_pid; + + wait_pid = wait(&statusp); + status = (int *) statusp.w_status; + + return wait_pid; +} + + +int +posix_utime(char *filename,struct utimbuf *buf) +{ + time_t timep[2]; + + timep[0] = buf->actime; + timep[1] = buf->modtime; + + #undef utime /* Use NeXT's utime() function */ + return utime(filename,timep); +} + + int waitpid(int pid, int *stat_loc, int options) { diff --git a/next-posix.h b/next-posix.h index 86683db5..13aaaa2c 100644 --- a/next-posix.h +++ b/next-posix.h @@ -10,15 +10,10 @@ #include #include -#define NAME_MAX 255 -struct dirent { - off_t d_off; - unsigned long d_fileno; - unsigned short d_reclen; - unsigned short d_namlen; - char d_name[NAME_MAX + 1]; -}; +/* readdir() returns struct direct (BSD) not struct dirent (POSIX) */ +#define dirent direct +/* POSIX utime() struct */ struct utimbuf { time_t actime; time_t modtime; @@ -32,15 +27,22 @@ struct utimbuf { #undef WIFSTOPPED #undef WIFSIGNALED -#define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */ -#define WIFEXITED(w) (!((_W_INT(w)) & 0377)) -#define WIFSTOPPED(w) ((_W_INT(w)) & 0100) +#define WIFEXITED(w) (!((w) & 0377)) +#define WIFSTOPPED(w) ((w) & 0100) #define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w)) -#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1) -#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1) +#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((w >> 8) & 0377) : -1) +#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (w & 0177) : -1) #define WCOREFLAG 0x80 -#define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG) +#define WCOREDUMP(w) ((w) & WCOREFLAG) + +/* POSIX "wrapper" functions to replace to BSD functions */ +int posix_utime(char *filename, struct utimbuf *buf); /* new utime() */ +#define utime posix_utime + +pid_t posix_wait(int *status); /* new wait() */ +#define wait posix_wait +/* MISC functions */ int waitpid(int pid,int *stat_loc,int options); #define getpgrp() getpgrp(0) pid_t setsid(void); diff --git a/scp.c b/scp.c index 5a5d0f46..3b356a9c 100644 --- a/scp.c +++ b/scp.c @@ -1212,7 +1212,7 @@ progressmeter(int flag) if (flag == -1) { struct sigaction sa; sa.sa_handler = updateprogressmeter; - sigemptyset(&sa.sa_mask); + sigemptyset((sigset_t *)&sa.sa_mask); #ifdef SA_RESTART sa.sa_flags = SA_RESTART; #endif