X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c25e555e6ffca87394f2dee5e4090406a6e45259..bddd9ca00cd2e2e73aded115a59614af3a74a6cb:/uip/mkstemp.c diff --git a/uip/mkstemp.c b/uip/mkstemp.c index b7acbb14..b95de57f 100644 --- a/uip/mkstemp.c +++ b/uip/mkstemp.c @@ -19,8 +19,6 @@ #include #include -#include - #if ! defined HAVE_MKSTEMPS # define HAVE_MKSTEMPS 0 #endif /* ! HAVE_MKSTEMPS */ @@ -44,7 +42,7 @@ main(int argc, char *argv[]) { process_args(argc, argv, &directory, &prefix, &suffix); if ((template = build_template(directory, prefix, suffix)) == NULL) { - return -1; + return 1; } if ((suffix_len = strlen(suffix)) > 0) { @@ -64,7 +62,7 @@ main(int argc, char *argv[]) { free(template); - return fd >= 0 ? 0 : -1; + return fd >= 0 ? 0 : 1; } @@ -120,6 +118,7 @@ build_template(const char *directory, const char *prefix, const char *suffix) { #if NMH #include +#include #if HAVE_MKSTEMPS # define MHFIXMSG_SWITCHES \ @@ -152,7 +151,7 @@ process_args(int argc, char **argv, const char **directory, NMH_UNUSED(suffix); # endif /* ! HAVE_MKSTEMPS */ - if (nmh_init(argv[0], 2)) { done(NOTOK); } + if (nmh_init(argv[0], 2)) { done(1); } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -164,12 +163,12 @@ process_args(int argc, char **argv, const char **directory, switch (smatch(++cp, switches)) { case AMBIGSW: ambigsw(cp, switches); - done(NOTOK); + done(1); case UNKWNSW: inform("-%s unknown", cp); (void) snprintf(buf, sizeof buf, "%s [switches]", invo_name); print_help(buf, switches, 1); - done(NOTOK); + done(1); case HELPSW: (void) snprintf(buf, sizeof buf, "%s [switches]", invo_name); print_help(buf, switches, 1); @@ -237,7 +236,7 @@ process_args(int argc, char **argv, const char **directory, exit(0); default: (void) fprintf(stderr, usage, argv[0]); - exit(-1); + exit(1); } } }