projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libbb: add a function to make a copy of a region of memory
[oweals/busybox.git]
/
util-linux
/
scriptreplay.c
diff --git
a/util-linux/scriptreplay.c
b/util-linux/scriptreplay.c
index 038dbdfe1400b0ac423cd30136577dba94725dc7..382f56d9a34b27b9de64648f6b4da3e815d940b4 100644
(file)
--- a/
util-linux/scriptreplay.c
+++ b/
util-linux/scriptreplay.c
@@
-4,9
+4,15
@@
*
* pascal.bellard@ads-lu.com
*
*
* pascal.bellard@ads-lu.com
*
- * Licensed under GPLv2 or later, see file L
icense in this tarball for details
.
+ * Licensed under GPLv2 or later, see file L
ICENSE in this source tree
.
*
*/
*
*/
+
+//usage:#define scriptreplay_trivial_usage
+//usage: "timingfile [typescript [divisor]]"
+//usage:#define scriptreplay_full_usage "\n\n"
+//usage: "Play back typescripts, using timing information"
+
#include "libbb.h"
int scriptreplay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
#include "libbb.h"
int scriptreplay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@
-18,6
+24,9
@@
int scriptreplay_main(int argc UNUSED_PARAM, char **argv)
unsigned long count;
FILE *tfp;
unsigned long count;
FILE *tfp;
+ if (!argv[1])
+ bb_show_usage();
+
if (argv[2]) {
script = argv[2];
if (argv[3])
if (argv[2]) {
script = argv[2];
if (argv[3])
@@
-30,9
+39,9
@@
int scriptreplay_main(int argc UNUSED_PARAM, char **argv)
usleep(delay * factor);
bb_copyfd_exact_size(fd, STDOUT_FILENO, count);
}
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;
}
return EXIT_SUCCESS;
}