]> arthur.barton.de Git - netatalk.git/commitdiff
autoconf POSIX.1 sys/wait.h check
authorrufustfirefly <rufustfirefly>
Thu, 6 Sep 2001 19:04:39 +0000 (19:04 +0000)
committerrufustfirefly <rufustfirefly>
Thu, 6 Sep 2001 19:04:39 +0000 (19:04 +0000)
etc/atalkd/main.c
etc/papd/main.c
etc/papd/session.c
etc/psf/psf.c
libatalk/asp/asp_getsess.c
libatalk/dsi/dsi_getsess.c
libatalk/pap/pap_slinit.c
libatalk/util/server_child.c

index 39146f3c422a4a47b241b5b00b9effad7ccaaf4d..64f81948d09f9a96b73c5fceef2024c5b9cf2803 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.7 2001-08-15 01:39:39 srittau Exp $
+ * $Id: main.c,v 1.8 2001-09-06 19:04:39 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -9,7 +9,6 @@
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/socket.h>
 #if defined( sun ) && defined( __svr4__ )
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/ioctl.h>
+
+/* POSIX.1 check */
+#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+#ifndef WEXITSTATUS 
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif /* ! WEXITSTATUS */
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif /* ! WIFEXITED */
+
 #include <errno.h>
 #ifdef TRU64
 #include <sys/mbuf.h>
index e60ca5888656a8a7acf4f81b9e11dc2c853911e4..ffa60e36090ebfbaac839b79759acddec658c36e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.9 2001-08-03 22:13:28 srittau Exp $
+ * $Id: main.c,v 1.10 2001-09-06 19:04:40 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -10,7 +10,6 @@
 #endif /* HAVE_CONFIG_H */
 
 #include <sys/param.h>
-#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/uio.h>
 #if defined( sun ) && defined( __svr4__ )
 #endif /* sun && __svr4__ */
 #include <sys/socket.h>
 #include <sys/syslog.h>
+
+/* POSIX.1 sys/wait.h check */
+#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
-#include <errno.h>
+#endif /* HAVE_SYS_WAIT_H */
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif /* ! WEXITSTATUS */
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif /* ! WIFEXITED */
 
+#include <errno.h>
 #include <string.h>
 #include <signal.h>
 #include <stdio.h>
index 9d7af98e2b472b065e37076b1264665a33c2051a..69d3f5e8b18b4d5dff05503d25265a97c6692fc5 100644 (file)
@@ -1,15 +1,21 @@
 /*
- * $Id: session.c,v 1.10 2001-08-09 13:29:59 rufustfirefly Exp $
+ * $Id: session.c,v 1.11 2001-09-06 19:04:40 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
-#include <sys/errno.h>
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#ifdef HAVE_SYS_ERRNO_H
+#include <sys/errno.h>
+#endif /* HAVE_SYS_ERRNO_H */
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif /* HAVE_ERRNO_H */
+
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
index 53d3a543124beec8b82ed60700def2faeafa3904..c29467b9e027bf7dc8985408a1df9165acaaba2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: psf.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $
+ * $Id: psf.c,v 1.5 2001-09-06 19:04:40 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1995 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
 #include <sys/time.h>
+
+/* POSIX.1 sys/wait.h check */
 #include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif /* ! WEXITSTATUS */
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif /* ! WIFEXITED */
+
 #include <sys/file.h>
 #include <sys/syslog.h>
 #include <atalk/paths.h>
index 2a2826f9d17e722334da77515efb2ffed249fe5a..4c7765d56c6518cb882aad4b71babe95f86b2ab3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: asp_getsess.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ * $Id: asp_getsess.c,v 1.4 2001-09-06 19:04:40 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include <errno.h>
 #include <sys/signal.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/uio.h>
+
+/* POSIX.1 sys/wait.h check */
+#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif /* ! WEXITSTATUS */
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif /* ! WIFEXITED */
+
 #include <sys/socket.h>
 #include <sys/param.h>
 #include <netatalk/at.h>
index cd28d383fa13b536f4fdc72a26d5c399174c4caf..7f5e3f9256d4184e957d725fc6bdabdd4e53955b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dsi_getsess.c,v 1.4 2001-08-15 02:18:57 srittau Exp $
+ * $Id: dsi_getsess.c,v 1.5 2001-09-06 19:04:40 rufustfirefly Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_H */
-#include <sys/types.h>
 #include <signal.h>
+
+/* POSIX.1 sys/wait.h check */
+#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif /* ! WEXITSTATUS */
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif /* ! WIFEXITED */
+
 #include <sys/time.h>
 #include <syslog.h>
 
index 7a8e490da0cdd70de638424abd8557f9536f6b24..df5733a5f3f01a1564a9df9b31a74f3aa4fe291f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: pap_slinit.c,v 1.3 2001-06-29 14:14:47 rufustfirefly Exp $
+ * $Id: pap_slinit.c,v 1.4 2001-09-06 19:04:40 rufustfirefly Exp $
  *
  * Copyright (c) 1990,1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include <errno.h>
 #include <sys/signal.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/uio.h>
+
+/* POSIX.1 sys/wait.h check */
+#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif /* ! WEXITSTATUS */
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif /* ! WIFEXITED */
+
 #include <sys/socket.h>
 #include <sys/param.h>
 #include <netatalk/at.h>
index 5ecc7368aa9d3156d294ce9994dafd6213e38ace..0d6169e252ecf92e810fbe7278430845330d8463 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: server_child.c,v 1.4 2001-09-06 19:04:40 rufustfirefly Exp $
+ *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif /* HAVE_UNISTD_H */
 #include <signal.h>
 #include <syslog.h>
+
+/* POSIX.1 sys/wait.h check */
 #include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif /* ! WEXITSTATUS */
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif /* ! WIFEXITED */
 
 #include <atalk/server_child.h>
 
 #ifndef __inline__
 #define __inline__
-#endif
+#endif /* ! __inline__ */
 
 /* hash/child functions: hash OR's pid */
 #define CHILD_HASHSIZE 32
@@ -224,7 +238,7 @@ void server_child_handler(server_child *children)
   
 #ifndef WAIT_ANY
 #define WAIT_ANY (-1)
-#endif
+#endif /* ! WAIT_ANY */
 
   while ((pid = waitpid(WAIT_ANY, &status, WNOHANG)) > 0) {
     for (i = 0; i < children->nforks; i++) {