X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Futil%2Fserver_child.c;h=0d6169e252ecf92e810fbe7278430845330d8463;hb=f4c70982f27d940f0428140a18ac9dbf9cc92ed5;hp=5ecc7368aa9d3156d294ce9994dafd6213e38ace;hpb=0918f69ed3d4e17b0bfac6f96764ca0dafa63a47;p=netatalk.git 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++) {