From: ceriel Date: Thu, 19 Sep 1991 11:26:10 +0000 (+0000) Subject: Several fixes X-Git-Tag: release-5-5~842 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6e485ef1690175149abd5834f089c3d7808c5b0c;p=ack.git Several fixes --- diff --git a/mach/minix/libsys/_exec.c b/mach/minix/libsys/_exec.c index 00287eddb..cc4ddf9ad 100644 --- a/mach/minix/libsys/_exec.c +++ b/mach/minix/libsys/_exec.c @@ -1,4 +1,5 @@ #include +#include #define execl _execl #define execle _execle #define execv _execv diff --git a/mach/minix/libsys/_fcntl.c b/mach/minix/libsys/_fcntl.c index 98a0f73c5..f96eebf6f 100644 --- a/mach/minix/libsys/_fcntl.c +++ b/mach/minix/libsys/_fcntl.c @@ -2,22 +2,31 @@ #define fcntl _fcntl #include #if _ANSI -#include #endif #if _ANSI +#include PUBLIC int fcntl(int fd, int cmd, ...) +{ #else -PUBLIC int fcntl(fd, cmd) +#include +PUBLIC int fcntl(va_alist) +va_dcl +{ int fd; int cmd; #endif -{ - va_list argp; + va_list ap; int int3; /* third integer parameter for callm1 */ char *ptr1; /* first pointer parameter for callm1 */ - va_start(argp, cmd); +#if _ANSI + va_start(ap, cmd); +#else + va_start(ap); + fd = va_arg(ap, int); + cmd = va_arg(ap, int); +#endif /* Set up for the sensible case where there is no variable parameter. This * covers F_GETFD, F_GETFL and invalid commands. @@ -30,16 +39,16 @@ int cmd; case F_DUPFD: case F_SETFD: case F_SETFL: - int3 = va_arg(argp, int); + int3 = va_arg(ap, int); break; case F_GETLK: case F_SETLK: case F_SETLKW: - ptr1 = (char *) va_arg(argp, struct flock *); + ptr1 = (char *) va_arg(ap, struct flock *); break; } /* Clean up and make the system call. */ - va_end(argp); + va_end(ap); return(_callm1(FS, FCNTL, fd, cmd, int3, ptr1, NIL_PTR, NIL_PTR)); } diff --git a/mach/minix/libsys/_getcwd.c b/mach/minix/libsys/_getcwd.c index b069b4826..92546aa73 100644 --- a/mach/minix/libsys/_getcwd.c +++ b/mach/minix/libsys/_getcwd.c @@ -13,7 +13,7 @@ #define DIRECT_SIZE (sizeof (struct direct)) -PRIVATE _PROTOTYPE(void, go_back(char *path) ); +PRIVATE _PROTOTYPE(void go_back, (char *path) ); char *getcwd(buffer, size) char *buffer; diff --git a/mach/minix/libsys/fpathconf.c b/mach/minix/libsys/fpathconf.c index a1ff6f5e1..8448d9c36 100644 --- a/mach/minix/libsys/fpathconf.c +++ b/mach/minix/libsys/fpathconf.c @@ -1,6 +1,7 @@ /* POSIX fpathconf (Sec. 5.7.1) Author: Andy Tanenbaum */ #include +#include #include #define fstat _fstat #include