Fixing an error measuring times
authorviric@llimona
Tue, 10 Apr 2007 00:08:52 +0200
changeset 116 5fe47d692522
parent 115 367ada1cb69b
child 117 db479ef293d3
Fixing an error measuring times
execute.c
--- a/execute.c	Mon Apr 09 20:19:27 2007 +0200
+++ b/execute.c	Tue Apr 10 00:08:52 2007 +0200
@@ -43,10 +43,10 @@
         res = read(fd_read_filename, ofname, namesize);
         if (res != namesize)
             error("Reading the the out file name");
-        res = read(fd_read_filename, &starttv, sizeof(starttv));
-        if (res != sizeof(starttv))
-            error("Reading the the struct timeval");
     }
+    res = read(fd_read_filename, &starttv, sizeof(starttv));
+    if (res != sizeof(starttv))
+        error("Reading the the struct timeval");
     close(fd_read_filename);
 
     c_send_runjob_ok(ofname, pid);
@@ -169,10 +169,10 @@
         namesize = sizeof(outfname);
         res = write(fd_send_filename, (char *)&namesize, sizeof(namesize));
         write(fd_send_filename, outfname, sizeof(outfname));
-        /* Times */
-        gettimeofday(&starttv, NULL);
-        write(fd_send_filename, &starttv, sizeof(starttv));
     }
+    /* Times */
+    gettimeofday(&starttv, NULL);
+    write(fd_send_filename, &starttv, sizeof(starttv));
     close(fd_send_filename);
 
     /* Closing input */