scoutfs: return non-zero status on error

The error return conventions were confused, resulting in main exiting
with success when command execution failed.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2019-05-29 10:40:05 -07:00
committed by Zach Brown
parent 336a6a155d
commit da185b214b
3 changed files with 4 additions and 9 deletions

View File

@@ -60,7 +60,8 @@ static void usage(void)
}
}
int cmd_execute(int argc, char **argv)
/* this returns a positive unix return code on error for some reason */
char cmd_execute(int argc, char **argv)
{
struct command *com = NULL;
int ret;

View File

@@ -4,6 +4,6 @@
void cmd_register(char *name, char *opts, char *summary,
int (*func)(int argc, char **argv));
int cmd_execute(int argc, char **argv);
char cmd_execute(int argc, char **argv);
#endif

View File

@@ -10,15 +10,9 @@
int main(int argc, char **argv)
{
int ret;
/*
* XXX parse global options, env, configs, etc.
*/
ret = cmd_execute(argc, argv);
if (ret < 0)
return 1;
return 0;
return cmd_execute(argc, argv);
}