]> andersk Git - moira.git/commitdiff
make it compile on AIX
authormar <mar>
Tue, 22 Sep 1992 14:16:03 +0000 (14:16 +0000)
committermar <mar>
Tue, 22 Sep 1992 14:16:03 +0000 (14:16 +0000)
update/exec_002.c

index 887c4b1316a3d7014069ca0f271435c9a65ebd92..eea177351fc43a08e4f4ac2363096fedd537292e 100644 (file)
@@ -24,19 +24,27 @@ extern CONNECTION conn;
 extern int code, errno, uid;
 extern char *whoami;
 
+#if defined(vax) || defined(ibm032)
+#define WEXITSTATUS(waitb) ((waitb).w_retcode)
+#endif
+
 
 int
 exec_002(str)
     char *str;
 {
+#ifdef _AIX
+    int waitb;
+#else
     union wait waitb;
+#endif
     int n, pid, mask;
 
     if (config_lookup("noexec")) {
        code = EPERM;
        code = send_object(conn, (char *)&code, INTEGER_T);
        com_err(whoami, code, "Not allowed to execute");
-       return;
+       return(0);
     }
     str += 8;
     while (*str == ' ')
@@ -52,7 +60,7 @@ exec_002(str)
        code = send_object(conn, (char *)&n, INTEGER_T);
        if (code)
            exit(1);
-       return;
+       return(0);
     case 0:
        if (setuid(uid) < 0) {
            com_err(whoami, errno, "Unable to setuid to %d\n", uid);
@@ -71,10 +79,11 @@ exec_002(str)
            n = wait(&waitb);
        } while (n != -1 && n != pid);
        sigsetmask(mask);
-       if (waitb.w_status) {
-           n = waitb.w_retcode + ERROR_TABLE_BASE_sms;
+       if (WEXITSTATUS(waitb)) {
+           n = WEXITSTATUS(waitb) + ERROR_TABLE_BASE_sms;
            log_priority = log_ERROR;
-           com_err(whoami, n, " child exited with status %d", waitb.w_retcode);
+           com_err(whoami, n, " child exited with status %d",
+                   WEXITSTATUS(waitb));
            code = send_object(conn, (char *)&n, INTEGER_T);
            if (code) {
                exit(1);
This page took 0.041104 seconds and 5 git commands to generate.