From f192c2f4a34f8adb17eb3f0a4c91bb540012b4ea Mon Sep 17 00:00:00 2001 From: John Carr Date: Sun, 23 Feb 1992 12:21:47 +0000 Subject: [PATCH] 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 --- src/lib/krb5/posix/syslog.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 */ -- 2.26.2