summaryrefslogtreecommitdiffstats
path: root/term-utils/script.c
diff options
context:
space:
mode:
authorSami Kerola2014-12-27 11:14:28 +0100
committerSami Kerola2015-06-08 22:53:36 +0200
commitb09feab9e47d214f269230c605b07cb57af3384c (patch)
tree82eabc1edd93fafc4a9be3d5c7c1c1539140284a /term-utils/script.c
parentscript: replace strftime() workaround with CFLAGS = -Wno-format-y2k (diff)
downloadkernel-qcow2-util-linux-b09feab9e47d214f269230c605b07cb57af3384c.tar.gz
kernel-qcow2-util-linux-b09feab9e47d214f269230c605b07cb57af3384c.tar.xz
kernel-qcow2-util-linux-b09feab9e47d214f269230c605b07cb57af3384c.zip
script: use correct input type, move comment, and so on
Minor corrections. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/script.c')
-rw-r--r--term-utils/script.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/term-utils/script.c b/term-utils/script.c
index d045111c7..a085c53db 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -199,7 +199,7 @@ static void finish(struct script_control *ctl, int wait)
pid_t pid;
int options = wait ? 0 : WNOHANG;
- while ((pid = wait3(&status, options, 0)) > 0)
+ while ((pid = wait3(&status, options, NULL)) > 0)
if (pid == ctl->child)
ctl->childstatus = status;
}
@@ -483,14 +483,6 @@ static void getmaster(struct script_control *ctl)
#endif /* not HAVE_LIBUTIL */
}
-/*
- * script -t prints time delays as floating point numbers
- * The example program (scriptreplay) that we provide to handle this
- * timing output is a perl script, and does not handle numbers in
- * locale format (not even when "use locale;" is added).
- * So, since these numbers are not for human consumption, it seems
- * easiest to set LC_NUMERIC here.
- */
int main(int argc, char **argv)
{
struct script_control ctl = {
@@ -519,7 +511,14 @@ int main(int argc, char **argv)
};
setlocale(LC_ALL, "");
- setlocale(LC_NUMERIC, "C"); /* see comment above */
+ /*
+ * script -t prints time delays as floating point numbers. The example
+ * program (scriptreplay) that we provide to handle this timing output
+ * is a perl script, and does not handle numbers in locale format (not
+ * even when "use locale;" is added). So, since these numbers are not
+ * for human consumption, it seems easiest to set LC_NUMERIC here.
+ */
+ setlocale(LC_NUMERIC, "C");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
atexit(close_stdout);
@@ -556,7 +555,6 @@ int main(int argc, char **argv)
case 'h':
usage(stdout);
break;
- case '?':
default:
usage(stderr);
}
@@ -605,6 +603,6 @@ int main(int argc, char **argv)
if (ctl.child == 0)
doshell(&ctl);
do_io(&ctl);
-
- return EXIT_SUCCESS;
+ /* should not happen, do_io() calls done() */
+ return EXIT_FAILURE;
}