]> andersk Git - moira.git/commitdiff
Fix `Unable to read from program: Interrupted system call' on exit.
authordanw <danw>
Wed, 22 Jan 1997 22:54:43 +0000 (22:54 +0000)
committerdanw <danw>
Wed, 22 Jan 1997 22:54:43 +0000 (22:54 +0000)
Also sync code between startdcm, startreg, and startmoira

dcm/startdcm.c
reg_svr/startreg.c
server/startmoira.c

index e2fdac8bf02d79acfa2286dcdee93345c8415bd6..0f31bcfb3c5d3454dee0c664f44978bc568401bf 100644 (file)
@@ -32,7 +32,7 @@ static char *rcsid_mr_starter_c = "$Header$";
 int rdpipe[2];
 extern int errno;
 
-void cleanup()
+cleanup()
 {
        int stat, serrno = errno;
        char buf[BUFSIZ];
@@ -47,7 +47,7 @@ void cleanup()
                                        WEXITSTATUS(stat));
                }
                if (WIFSIGNALED(stat)) {
-                       sprintf(buf, "exited with signal %d%s\n",
+                       sprintf(buf, "exited on signal %d%s\n",
                                WTERMSIG(stat),
                                (WCOREDUMP(stat)?"; Core dumped":0));
                }
@@ -69,7 +69,7 @@ main(argc, argv)
        
        struct sigaction action;
        int nfds;
-
+       
        getrlimit(RLIMIT_NOFILE, &rl);
        nfds = rl.rlim_cur;
 
@@ -77,7 +77,7 @@ main(argc, argv)
        action.sa_flags = 0;
        sigemptyset(&action.sa_mask);
        sigaction(SIGCHLD, &action, NULL);
-
+       
        sprintf(buf, "%s/%s.log", SMS_DIR, PROG);
        logf = open(buf, O_CREAT|O_WRONLY|O_APPEND, 0640);
        if (logf<0) {
@@ -131,7 +131,7 @@ main(argc, argv)
                done = 0;
                errno = 0;
                if (fgets(buf, BUFSIZ, prog) == NULL) {
-                       if (errno) {
+                       if (errno && errno!=EINTR) {
                                strcpy(buf, "Unable to read from program: ");
                                strcat(buf, sys_errlist[errno]);
                                strcat(buf, "\n");
@@ -145,7 +145,3 @@ main(argc, argv)
        } while (!done);
        exit(0);
 }
-
-
-
-         
index 92d6fc6c485d9e9e120797f9041bc5b07cc0f377..2b620fccd08b8811ebae7d6b5973a8e62a16900d 100644 (file)
@@ -24,20 +24,18 @@ static char *rcsid_mr_starter_c = "$Header$";
 #include <sys/signal.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
-#include <sys/stat.h>
 #include <sys/resource.h>
 #include <moira_site.h>
 
 #define PROG   "reg_svr"
 
 int rdpipe[2];
+extern int errno;
 
 cleanup()
 {
-       int stat;        
+       int stat, serrno = errno;
        char buf[BUFSIZ];
-       extern int errno;
-       int serrno = errno;
 
        buf[0]='\0';
        
@@ -133,7 +131,7 @@ main(argc, argv)
                done = 0;
                errno = 0;
                if (fgets(buf, BUFSIZ, prog) == NULL) {
-                       if (errno) {
+                       if (errno && errno!=EINTR) {
                                strcpy(buf, "Unable to read from program: ");
                                strcat(buf, sys_errlist[errno]);
                                strcat(buf, "\n");
@@ -147,7 +145,3 @@ main(argc, argv)
        } while (!done);
        exit(0);
 }
-
-
-
-         
index 71323cf9582742704f46ad070744e326f42743c3..f35fa07fe6cf14c834a6c90977c2fcc5c58b7a80 100644 (file)
@@ -24,24 +24,21 @@ static char *rcsid_mr_starter_c = "$Header$";
 #include <sys/wait.h>
 #include <sys/signal.h>
 #include <sys/ioctl.h>
-#include <moira_site.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
 #include <fcntl.h>
+#include <sys/resource.h>
+#include <moira_site.h>
 
 
 #define PROG   "moirad"
 
 int rdpipe[2];
+extern int errno;
 char *whoami;
 
 cleanup()
 {
-       int stat;
-
+       int stat, serrno = errno;
        char buf[BUFSIZ];
-       extern int errno;
-       int serrno = errno;
 
        buf[0]='\0';
        
@@ -80,9 +77,9 @@ main(argc, argv)
        
        struct sigaction action;
        int nfds;
-
+       
        whoami = argv[0];
-
+       
        getrlimit(RLIMIT_NOFILE, &rl);
        nfds = rl.rlim_cur;
 
@@ -144,7 +141,7 @@ main(argc, argv)
                done = 0;
                errno = 0;
                if (fgets(buf, BUFSIZ, prog) == NULL) {
-                       if (errno) {
+                       if (errno && errno!=EINTR) {
                                strcpy(buf, "Unable to read from program: ");
                                strcat(buf, sys_errlist[errno]);
                                strcat(buf, "\n");
@@ -158,7 +155,3 @@ main(argc, argv)
        } while (!done);
        exit(0);
 }
-
-
-
-         
This page took 0.276755 seconds and 5 git commands to generate.