From 20bda75303f7174acb9a2de18e50c2b34d4f7c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 22 Jun 2007 16:23:51 +0000 Subject: [PATCH] exit with 1 when an error occurs git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21494 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/mimeset.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/bin/mimeset.cpp b/src/bin/mimeset.cpp index 3ac521c98c..5b548d48ad 100644 --- a/src/bin/mimeset.cpp +++ b/src/bin/mimeset.cpp @@ -67,7 +67,7 @@ main(int argc, char **argv) // parse arguments if (argc < 2) - usage(-1); + usage(1); while (*++argv) { char *arg = *argv; @@ -87,7 +87,7 @@ main(int argc, char **argv) usage(0); else { fprintf(stderr, "unknown option \"%s\"\n", arg); - usage(-1); + usage(1); } } @@ -95,7 +95,6 @@ main(int argc, char **argv) BApplication app("application/x-vnd.haiku.mimeset"); - int err = 0; while (*argv) { char *arg = *argv++; @@ -105,14 +104,12 @@ main(int argc, char **argv) while (fgets(name, sizeof(name), stdin) != NULL) { name[strlen(name) - 1] = '\0'; // remove trailing '\n' - err = process_file(name); - if (err) - exit(err); + if (process_file(name) != B_OK) + exit(1); } } else { - err = process_file(arg); - if (err) - exit(err); + if (process_file(arg) != B_OK) + exit(1); } }