From: John Carr Date: Tue, 11 Feb 1992 03:19:24 +0000 (+0000) Subject: Use vfork only on BSD systems, and union wait only on BSD systems X-Git-Tag: krb5-1.0-beta2~258 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=614b64d2d523cf721e8768353e05d532285aa800;p=krb5.git Use vfork only on BSD systems, and union wait only on BSD systems prior to 4.3 Reno. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2204 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index 934801adf..31ec869b5 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -803,7 +803,17 @@ load_database(kdb5_edit, database_file_name) { static char *edit_av[4]; int error_ret, save_stderr; + + /* has been included, so BSD will be defined on + BSD systems */ +#if BSD > 0 && BSD <= 43 +#ifndef WEXITSTATUS +#define WEXITSTATUS(w) (w).w_retcode +#endif union wait waitb; +#else + int waitb; +#endif char request[1024]; krb5_error_code retval; @@ -816,6 +826,10 @@ load_database(kdb5_edit, database_file_name) edit_av[1] = "-R"; edit_av[2] = request; edit_av[3] = NULL; + +#ifndef BSD +#define vfork fork +#endif switch(vfork()) { case -1: com_err(progname, errno, "while trying to fork %s", @@ -848,7 +862,7 @@ load_database(kdb5_edit, database_file_name) } } - if (error_ret = waitb.w_retcode) { + if (error_ret = WEXITSTATUS(waitb)) { com_err(progname, 0, "%s returned a bad exit status (%d)", kdb5_edit, error_ret); exit(1);