function old new delta
cksum_main 296 315 +19
printenv_main 74 86 +12
uint32_t crc;
off_t length, filesize;
int bytes_read;
+ int exit_code = EXIT_SUCCESS;
uint8_t *cp;
#if ENABLE_DESKTOP
do {
int fd = open_or_warn_stdin(*argv ? *argv : bb_msg_standard_input);
- if (fd < 0)
+ if (fd < 0) {
+ exit_code = EXIT_FAILURE;
continue;
+ }
crc = 0;
length = 0;
crc, filesize, *argv);
} while (*argv && *++argv);
- fflush_stdout_and_exit(EXIT_SUCCESS);
+ fflush_stdout_and_exit(exit_code);
}
int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int printenv_main(int argc UNUSED_PARAM, char **argv)
{
+ int exit_code = EXIT_SUCCESS;
+
/* no variables specified, show whole env */
if (!argv[1]) {
int e = 0;
env = getenv(arg);
if (env)
puts(env);
+ else
+ exit_code = EXIT_FAILURE;
}
}
- fflush_stdout_and_exit(EXIT_SUCCESS);
+ fflush_stdout_and_exit(exit_code);
}