From 614b64d2d523cf721e8768353e05d532285aa800 Mon Sep 17 00:00:00 2001 From: John Carr Date: Tue, 11 Feb 1992 03:19:24 +0000 Subject: [PATCH] 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 --- src/slave/kpropd.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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); -- 2.26.2