From: John Carr Date: Sun, 23 Feb 1992 12:21:47 +0000 (+0000) Subject: Use fork() when vfork() isn't available. X-Git-Tag: krb5-1.0-beta2~228 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f192c2f4a34f8adb17eb3f0a4c91bb540012b4ea;p=krb5.git Use fork() when vfork() isn't available. Use "int" instead of "union wait" on SYSV, AIX, and POSIX. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2234 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/posix/syslog.c b/src/lib/krb5/posix/syslog.c index d9e2e8a3a..289057d2d 100644 --- a/src/lib/krb5/posix/syslog.c +++ b/src/lib/krb5/posix/syslog.c @@ -153,7 +153,11 @@ vsyslog(pri, fmt, ap) return; /* output the message to the console */ +#if defined(SYSV) || defined(_AIX) + pid = fork(); +#else pid = vfork(); +#endif if (pid == -1) return; if (pid == 0) { @@ -171,8 +175,14 @@ vsyslog(pri, fmt, ap) (void)close(fd); _exit(0); } +#if defined(SYSV) || defined(_AIX) || defined(_POSIX_SOURCE) +#define cast int * +#else +#define cast union wait * +#endif if (!(LogStat & LOG_NOWAIT)) - while ((cnt = wait((union wait *)0)) > 0 && cnt != pid); + while ((cnt = wait((cast)0)) > 0 && cnt != pid); +#undef cast } static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */