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 9183d93..7b4d77e 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;
 }