X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fyes.c;h=7d9596d0bf72156b53426ec0013254a6fdd127a1;hb=e3e2a7b41cf130004c2be3402c34646dc0ef3e24;hp=0191bb003592bc2b3c88e226c9def60b3d69a3c4;hpb=3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217;p=oweals%2Fbusybox.git diff --git a/coreutils/yes.c b/coreutils/yes.c index 0191bb003..7d9596d0b 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c @@ -20,28 +20,24 @@ * */ -#include "internal.h" -#include +/* getopt not needed */ -const char yes_usage[] = - "yes [OPTION]... [STRING]...\n" -#ifndef BB_FEATURE_TRIVIAL_HELP - "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n" -#endif - ; +#include +#include +#include "busybox.h" extern int yes_main(int argc, char **argv) { int i; if (argc >= 2 && *argv[1] == '-') - usage(yes_usage); + show_usage(); if (argc == 1) { while (1) if (puts("y") == EOF) { perror("yes"); - exit(FALSE); + return EXIT_FAILURE; } } @@ -50,7 +46,8 @@ extern int yes_main(int argc, char **argv) if (fputs(argv[i], stdout) == EOF || putchar(i == argc - 1 ? '\n' : ' ') == EOF) { perror("yes"); - exit(FALSE); + return EXIT_FAILURE; } - exit(TRUE); + + return EXIT_SUCCESS; }