/*
- * $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.
#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>
/*
- * $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.
#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>
/*
- * $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>
/*
- * $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>
/*
- * $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>
/*
- * $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>
/*
- * $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>
/*
+ * $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
#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++) {