]> 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)
committerWolfgang Richter <wolf@cs.cmu.edu>
Thu, 20 Mar 2014 02:45:48 +0000 (22:45 -0400)
term-utils/script.c

index 456958b609afc56db6003186af3e450b7583ead4..e5d239c9b8540a9fbb0936abaee727599896ed01 100644 (file)
@@ -422,13 +422,14 @@ dooutput(void) {
                        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)