X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=util-linux%2Fscriptreplay.c;h=6eaba43fa607ef63d471a51836742e1fae7f130a;hb=38292b68c962b9d470fa4e577020749c8c69226d;hp=038dbdfe1400b0ac423cd30136577dba94725dc7;hpb=5e61115ea45c621867941e52e6ac016680415656;p=oweals%2Fbusybox.git diff --git a/util-linux/scriptreplay.c b/util-linux/scriptreplay.c index 038dbdfe1..6eaba43fa 100644 --- a/util-linux/scriptreplay.c +++ b/util-linux/scriptreplay.c @@ -4,7 +4,7 @@ * * pascal.bellard@ads-lu.com * - * Licensed under GPLv2 or later, see file License in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. * */ #include "libbb.h" @@ -18,6 +18,9 @@ int scriptreplay_main(int argc UNUSED_PARAM, char **argv) unsigned long count; FILE *tfp; + if (!argv[1]) + bb_show_usage(); + if (argv[2]) { script = argv[2]; if (argv[3]) @@ -30,9 +33,9 @@ int scriptreplay_main(int argc UNUSED_PARAM, char **argv) usleep(delay * factor); bb_copyfd_exact_size(fd, STDOUT_FILENO, count); } -#if ENABLE_FEATURE_CLEAN_UP - close(fd); - fclose(tfp); -#endif + if (ENABLE_FEATURE_CLEAN_UP) { + close(fd); + fclose(tfp); + } return EXIT_SUCCESS; }