diff options
author | Karel Zak | 2017-04-13 15:06:52 +0200 |
---|---|---|
committer | Karel Zak | 2017-04-13 15:06:52 +0200 |
commit | d05422417eec3fe0b85d158ac1b0bd3d1da4d6c6 (patch) | |
tree | bc764db2fabf420d91544cb9a30f1b487190dfa9 /term-utils/script.c | |
parent | Merge branch 'script_quiet' of https://github.com/renyuneyun/util-linux (diff) | |
download | kernel-qcow2-util-linux-d05422417eec3fe0b85d158ac1b0bd3d1da4d6c6.tar.gz kernel-qcow2-util-linux-d05422417eec3fe0b85d158ac1b0bd3d1da4d6c6.tar.xz kernel-qcow2-util-linux-d05422417eec3fe0b85d158ac1b0bd3d1da4d6c6.zip |
script: don't call strftime() if not necessary
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/script.c')
-rw-r--r-- | term-utils/script.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/term-utils/script.c b/term-utils/script.c index a58590188..86f92c226 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -434,9 +434,10 @@ static void do_io(struct script_control *ctl) } - strftime(buf, sizeof buf, "%c\n", localtime(&tvec)); - if (!ctl->quiet && ctl->typescriptfp) + if (!ctl->quiet && ctl->typescriptfp) { + strftime(buf, sizeof buf, "%c\n", localtime(&tvec)); fprintf(ctl->typescriptfp, _("Script started on %s"), buf); + } gettime_monotonic(&ctl->oldtime); while (!ctl->die) { |