summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CREDITS1
-rw-r--r--ChangeLog1
-rw-r--r--configure.in1
-rw-r--r--next-posix.c28
-rw-r--r--next-posix.h30
-rw-r--r--scp.c2
6 files changed, 47 insertions, 16 deletions
diff --git a/CREDITS b/CREDITS
index 4329838c..63a5e940 100644
--- a/CREDITS
+++ b/CREDITS
@@ -47,6 +47,7 @@ Kevin O'Connor <kevin_oconnor@standardandpoors.com> - RSAless operation
Kiyokazu SUTO <suto@ks-and-ks.ne.jp> - Bugfixes
Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> - Bugfixes
Marc G. Fournier <marc.fournier@acadiau.ca> - Solaris patches
+Mark Miller <markm@swoon.net> - Bugfixes
Matt Richards <v2matt@btv.ibm.com> - AIX patches
Michael Stone <mstone@cs.loyola.edu> - Irix enhancements
Nalin Dahyabhai <nalin.dahyabhai@pobox.com> - 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 <stevesk@sweden.hp.com>
+ - (djm) NeXT patch from Ben Lindstrom <mouring@pconline.com>
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 <errno.h>
+#include <sys/wait.h>
#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 <libc.h>
#include <sys/dir.h>
-#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