This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use CLOCK_REALTIME in clock_nanosleep check
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Thu, 20 Oct 2016 14:23:07 +0000 (15:23 +0100)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Sat, 12 Nov 2016 11:47:10 +0000 (12:47 +0100)
For consistency with the other checks that use CLOCK_* constants.

dist/Time-HiRes/Makefile.PL

index b497196..9060fa2 100644 (file)
@@ -351,7 +351,8 @@ int main(int argc, char** argv)
     struct timespec ts2;
     ts1.tv_sec  = 0;
     ts1.tv_nsec = 750000000;;
-    ret = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts1, &ts2);
+    /* All implementations are supposed to support CLOCK_REALTIME. */
+    ret = clock_nanosleep(CLOCK_REALTIME, 0, &ts1, &ts2);
     ret == 0 ? exit(0) : exit(errno ? errno : -1);
 }
 EOM