From f4c70982f27d940f0428140a18ac9dbf9cc92ed5 Mon Sep 17 00:00:00 2001 From: rufustfirefly Date: Thu, 6 Sep 2001 19:04:39 +0000 Subject: [PATCH] autoconf POSIX.1 sys/wait.h check --- etc/atalkd/main.c | 15 +++++++++++++-- etc/papd/main.c | 16 +++++++++++++--- etc/papd/session.c | 10 ++++++++-- etc/psf/psf.c | 13 ++++++++++++- libatalk/asp/asp_getsess.c | 15 +++++++++++++-- libatalk/dsi/dsi_getsess.c | 15 +++++++++++++-- libatalk/pap/pap_slinit.c | 15 +++++++++++++-- libatalk/util/server_child.c | 20 +++++++++++++++++--- 8 files changed, 102 insertions(+), 17 deletions(-) diff --git a/etc/atalkd/main.c b/etc/atalkd/main.c index 39146f3c..64f81948 100644 --- a/etc/atalkd/main.c +++ b/etc/atalkd/main.c @@ -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 #include #include #if defined( sun ) && defined( __svr4__ ) @@ -20,7 +19,19 @@ #include #include #include + +/* POSIX.1 check */ +#include +#ifdef HAVE_SYS_WAIT_H #include +#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 #ifdef TRU64 #include diff --git a/etc/papd/main.c b/etc/papd/main.c index e60ca588..ffa60e36 100644 --- a/etc/papd/main.c +++ b/etc/papd/main.c @@ -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 -#include #include #include #if defined( sun ) && defined( __svr4__ ) @@ -20,9 +19,20 @@ #endif /* sun && __svr4__ */ #include #include + +/* POSIX.1 sys/wait.h check */ +#include +#ifdef HAVE_SYS_WAIT_H #include -#include +#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 #include #include #include diff --git a/etc/papd/session.c b/etc/papd/session.c index 9d7af98e..69d3f5e8 100644 --- a/etc/papd/session.c +++ b/etc/papd/session.c @@ -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 #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ +#ifdef HAVE_SYS_ERRNO_H +#include +#endif /* HAVE_SYS_ERRNO_H */ +#ifdef HAVE_ERRNO_H +#include +#endif /* HAVE_ERRNO_H */ + #include #include #include diff --git a/etc/psf/psf.c b/etc/psf/psf.c index 53d3a543..c29467b9 100644 --- a/etc/psf/psf.c +++ b/etc/psf/psf.c @@ -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. @@ -27,8 +27,19 @@ #include #endif /* HAVE_UNISTD_H */ #include + +/* POSIX.1 sys/wait.h check */ #include +#ifdef HAVE_SYS_WAIT_H #include +#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 #include #include diff --git a/libatalk/asp/asp_getsess.c b/libatalk/asp/asp_getsess.c index 2a2826f9..4c7765d5 100644 --- a/libatalk/asp/asp_getsess.c +++ b/libatalk/asp/asp_getsess.c @@ -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. @@ -20,9 +20,20 @@ #include #include #include -#include #include + +/* POSIX.1 sys/wait.h check */ +#include +#ifdef HAVE_SYS_WAIT_H #include +#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 #include #include diff --git a/libatalk/dsi/dsi_getsess.c b/libatalk/dsi/dsi_getsess.c index cd28d383..7f5e3f92 100644 --- a/libatalk/dsi/dsi_getsess.c +++ b/libatalk/dsi/dsi_getsess.c @@ -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. @@ -16,9 +16,20 @@ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ -#include #include + +/* POSIX.1 sys/wait.h check */ +#include +#ifdef HAVE_SYS_WAIT_H #include +#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 #include diff --git a/libatalk/pap/pap_slinit.c b/libatalk/pap/pap_slinit.c index 7a8e490d..df5733a5 100644 --- a/libatalk/pap/pap_slinit.c +++ b/libatalk/pap/pap_slinit.c @@ -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. @@ -15,9 +15,20 @@ #include #include #include -#include #include + +/* POSIX.1 sys/wait.h check */ +#include +#ifdef HAVE_SYS_WAIT_H #include +#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 #include #include diff --git a/libatalk/util/server_child.c b/libatalk/util/server_child.c index 5ecc7368..0d6169e2 100644 --- a/libatalk/util/server_child.c +++ b/libatalk/util/server_child.c @@ -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. * @@ -14,21 +16,33 @@ #ifdef HAVE_CONFIG_H #include "config.h" -#endif +#endif /* HAVE_CONFIG_H */ #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ #include #include + +/* POSIX.1 sys/wait.h check */ #include +#ifdef HAVE_SYS_WAIT_H #include +#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 #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++) { -- 2.39.2