Code

return propper exit codes
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 7 Apr 2005 21:30:16 +0000 (21:30 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 7 Apr 2005 21:30:16 +0000 (21:30 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@369 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_tool.c

index 9183d93da7f6d3411f61810b841d784a257710c6..7b4d77eef43d544469ed8e8305c567ebd7e9e3dd 100644 (file)
@@ -356,15 +356,15 @@ int main(int argc, char *argv[])
                if ((myargv = (char **) malloc((argc+1) * 
                                               sizeof(char *))) == NULL)   {
                    perror("malloc");
-                   return -1;
+                   exit(1);
                }
                if ((argc=CreateArgs(argv[0], aLine, argc, myargv)) < 0) {
                    fprintf(stderr, "ERROR: creating arguments\n");
-                   return -1;
+                   exit(1);
                }
 
                if (HandleInputLine(argc, myargv, stdout))
-                   return -1;
+                   exit(1);
                free(myargv);
 
 #if HAVE_GETRUSAGE
@@ -395,9 +395,7 @@ int main(int argc, char *argv[])
                exit(0);
        }
     else {
-        if(HandleInputLine(argc, argv, stderr)) {
-            return 1;
-        }
+        exit(HandleInputLine(argc, argv, stderr));
     }
     return 0;
 }