From 15e29cfa0377c25eeb55719bb1171ad4215b76d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Wed, 30 Aug 2006 09:46:42 +0000 Subject: [PATCH] fix exit codes (1 on error, 0 on success) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18705 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/mount.c | 8 ++++---- src/bin/unmount.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/mount.c b/src/bin/mount.c index f61d344111..50885f56c1 100644 --- a/src/bin/mount.c +++ b/src/bin/mount.c @@ -21,7 +21,7 @@ usage(const char *programName) printf("usage: %s [-ro] [-t fstype] [-p parameter] device directory\n" "\t-ro\tmounts the volume read-only\n" "\t-t\tspecifies the file system to use (defaults to automatic recognition)\n",programName); - exit(0); + exit(1); } @@ -75,11 +75,11 @@ main(int argc, char **argv) if (stat(mountPoint, &mountStat) < 0) { fprintf(stderr, "%s: The mount point '%s' is not accessible\n", programName, mountPoint); - return -1; + return 1; } if (!S_ISDIR(mountStat.st_mode)) { fprintf(stderr, "%s: The mount point '%s' is not a directory\n", programName, mountPoint); - return -1; + return 1; } /* do the work */ @@ -87,7 +87,7 @@ main(int argc, char **argv) volume = fs_mount_volume(mountPoint, device, fs, flags, parameter); if (volume < B_OK) { fprintf(stderr, "%s: %s\n", programName, strerror(volume)); - return -1; + return 1; } return 0; } diff --git a/src/bin/unmount.c b/src/bin/unmount.c index b26d05a22e..1ad484022e 100644 --- a/src/bin/unmount.c +++ b/src/bin/unmount.c @@ -20,7 +20,7 @@ usage(const char *programName) printf("usage: %s [-f] \n" "\t-f\tforces unmounting in case of open files left\n", programName); - exit(0); + exit(1); } @@ -60,7 +60,7 @@ main(int argc, char **argv) if (stat(path, &pathStat) < 0) { fprintf(stderr, "%s: The path \"%s\" is not accessible\n", programName, path); - return -1; + return 1; } /* do the work */ @@ -68,7 +68,7 @@ main(int argc, char **argv) status = fs_unmount_volume(path, flags); if (status != B_OK) { fprintf(stderr, "%s: unmounting failed: %s\n", programName, strerror(status)); - return -1; + return 1; } return 0;