From 383b5f4303839ae631193455130aa08ef8f43454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 30 Aug 2006 10:06:19 +0000 Subject: [PATCH] fix error exit codes git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18707 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/chkbfs/chkbfs.cpp | 10 +++++----- src/bin/fdinfo.cpp | 4 ++-- src/bin/rmattr.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bin/chkbfs/chkbfs.cpp b/src/bin/chkbfs/chkbfs.cpp index 71f3d7fcdf..0f383ff761 100644 --- a/src/bin/chkbfs/chkbfs.cpp +++ b/src/bin/chkbfs/chkbfs.cpp @@ -39,7 +39,7 @@ openDevice(const char *name) int device = open(name, O_RDONLY); if (device < 0) - fprintf(stderr, "%s: could not open \"%s\": %s\n", gProgramName, name, strerror(device)); + fprintf(stderr, "%s: could not open \"%s\": %s\n", gProgramName, name, strerror(errno)); else { uint32 version; if (ioctl(device, BFS_IOCTL_VERSION, &version) < B_OK) { @@ -119,7 +119,7 @@ main(int argc, char **argv) if (argc < 2 || !strcmp(argv[1], "--help")) { printUsage(); - return -1; + return 1; } control.magic = BFS_IOCTL_CHECK_MAGIC; @@ -152,13 +152,13 @@ main(int argc, char **argv) int device = openDevice(argv[0]); if (device < 0) - return -1; + return 1; // start checking if (startChecking(device, control) < B_OK) { close(device); - return -1; + return 1; } // reset all counters @@ -208,7 +208,7 @@ main(int argc, char **argv) if (stopChecking(device, control) < B_OK) { close(device); - return -1; + return 1; } // print stats diff --git a/src/bin/fdinfo.cpp b/src/bin/fdinfo.cpp index 335d443286..800b8abb5b 100644 --- a/src/bin/fdinfo.cpp +++ b/src/bin/fdinfo.cpp @@ -143,7 +143,7 @@ main(int argc, char **argv) if (device < 0) { fprintf(stderr, "%s: could not find device: %s\n", __progname, strerror(errno)); - return -1; + return 1; } mode = kFilterDevice; if (argv[1][1] == 'D') @@ -154,7 +154,7 @@ main(int argc, char **argv) if (::stat(argv[2], &stat) < 0) { fprintf(stderr, "%s: could not open file: %s\n", __progname, strerror(errno)); - return -1; + return 1; } device = stat.st_dev; node = stat.st_ino; diff --git a/src/bin/rmattr.cpp b/src/bin/rmattr.cpp index af95e54be5..5a82ced557 100644 --- a/src/bin/rmattr.cpp +++ b/src/bin/rmattr.cpp @@ -33,7 +33,7 @@ usage() "\t'attr' is the name of an attribute of the file\n" "\tIf '-p' is specified, 'attr' is regarded as a pattern.\n", kProgramName); - exit(0); + exit(1); } @@ -110,7 +110,7 @@ main(int32 argc, const char **argv) if (fd < 0) { fprintf(stderr, "%s: can\'t open file %s to remove attribute: %s\n", kProgramName, argv[i], strerror(errno)); - return 0; + return 1; } if (remove_attribute(fd, argv[attr], isPattern) != B_OK) {