summaryrefslogtreecommitdiffstats
path: root/term-utils/script.c
diff options
context:
space:
mode:
authorKarel Zak2017-04-18 12:12:44 +0200
committerKarel Zak2017-04-18 12:12:44 +0200
commit6f3c9c34306cb40115dc878629667c22a36115a4 (patch)
treed34ba43f5ebdb70f2fe02b99afef5232c220ca74 /term-utils/script.c
parentMerge branch 'script_newline' of https://github.com/renyuneyun/util-linux (diff)
downloadkernel-qcow2-util-linux-6f3c9c34306cb40115dc878629667c22a36115a4.tar.gz
kernel-qcow2-util-linux-6f3c9c34306cb40115dc878629667c22a36115a4.tar.xz
kernel-qcow2-util-linux-6f3c9c34306cb40115dc878629667c22a36115a4.zip
script: always write stat and done message to typescript file
And remove usec from timestamp. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/script.c')
-rw-r--r--term-utils/script.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/term-utils/script.c b/term-utils/script.c
index 19ecddc93..f2fc2f59c 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -435,8 +435,8 @@ static void do_io(struct script_control *ctl)
}
- if (!ctl->quiet && ctl->typescriptfp) {
- strtime_iso(&tvec, ISO_8601_DATE | ISO_8601_TIME | ISO_8601_DOTUSEC |
+ if (ctl->typescriptfp) {
+ strtime_iso(&tvec, ISO_8601_DATE | ISO_8601_TIME |
ISO_8601_TIMEZONE | ISO_8601_SPACE,
buf, sizeof(buf));
fprintf(ctl->typescriptfp, _("Script started on %s\n"), buf);
@@ -510,9 +510,10 @@ static void do_io(struct script_control *ctl)
if (!ctl->die)
wait_for_child(ctl, 1);
- if (!ctl->quiet && ctl->typescriptfp) {
+
+ if (ctl->typescriptfp) {
tvec = script_time((time_t *)NULL);
- strtime_iso(&tvec, ISO_8601_DATE | ISO_8601_TIME | ISO_8601_DOTUSEC |
+ strtime_iso(&tvec, ISO_8601_DATE | ISO_8601_TIME |
ISO_8601_TIMEZONE | ISO_8601_SPACE,
buf, sizeof(buf));
fprintf(ctl->typescriptfp, _("\nScript done on %s\n"), buf);