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
This commit is contained in:
Jérôme Duval 2006-08-30 09:46:42 +00:00
parent 2761c5ae55
commit 15e29cfa03
2 changed files with 7 additions and 7 deletions

View File

@ -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;
}

View File

@ -20,7 +20,7 @@ usage(const char *programName)
printf("usage: %s [-f] <path to volume>\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;