]> granicus.if.org Git - sudo/commitdiff
Fix nanosleep emulation
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Sep 2009 13:18:30 +0000 (13:18 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Sep 2009 13:18:30 +0000 (13:18 +0000)
sudoreplay.c

index 3096fc2a00e29ec3ac75d9baefbf43589f2d8314..9228cfcd9167a5460aa4d3fbe7ce09c494a91368 100644 (file)
@@ -314,12 +314,12 @@ nanosleep(ts, rts)
     int rval;
 
     timeout.tv_sec = ts->tv_sec;
-    timeout.tv_usec = ts->tv_nsecs / 1000;
+    timeout.tv_usec = ts->tv_nsec / 1000;
     if (rts != NULL) {
        gettimeofday(&endtime, NULL);
        timeradd(&endtime, &timeout, &endtime);
     }
-    rval = select(NULL, NULL, NULL, &timeout);
+    rval = select(0, NULL, NULL, NULL, &timeout);
     if (rts != NULL && rval == -1 && errno == EINTR) {
        gettimeofday(&now, NULL);
        timersub(&endtime, &now, &timeout);