]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script: time from end of read() call partially fixes #58
authorWolfgang Richter <wolf@cs.cmu.edu>
Thu, 20 Mar 2014 02:45:48 +0000 (22:45 -0400)
committerKarel Zak <kzak@redhat.com>
Wed, 23 Apr 2014 09:55:08 +0000 (11:55 +0200)
term-utils/script.c

index 3180ddfd54ed3a9bca37bf813231969f692daf8a..89eee94e116e53a73ad5b3845a3b6ab8b5a66710 100644 (file)
@@ -378,13 +378,14 @@ dooutput(FILE *timingfd) {
                        if (poll(fds, 1, 50) <= 0)
                                break;
                }
-               if (tflg)
-                       gettimeofday(&tv, NULL);
 
                errno = 0;
                cc = read(master, obuf, sizeof (obuf));
                errsv = errno;
 
+               if (tflg)
+                       gettimeofday(&tv, NULL);
+
                if (errsv == EINTR && cc <= 0)
                        continue;       /* try it again */
                if (cc <= 0)