Tue Oct 4 12:48:15 2016 UTC ()
return 0 on unsupported bases.


(christos)
diff -r1.1 -r1.2 src/lib/libc/gen/timespec_get.c

cvs diff -r1.1 -r1.2 src/lib/libc/gen/timespec_get.c (expand / switch to context diff)
--- src/lib/libc/gen/timespec_get.c 2016/10/04 09:41:41 1.1
+++ src/lib/libc/gen/timespec_get.c 2016/10/04 12:48:15 1.2
@@ -1,4 +1,4 @@
-/*	$NetBSD: timespec_get.c,v 1.1 2016/10/04 09:41:41 kamil Exp $	*/
+/*	$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: timespec_get.c,v 1.1 2016/10/04 09:41:41 kamil Exp $");
+__RCSID("$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $");
 #endif /* !defined lint */
 
 #include <assert.h>
@@ -47,8 +47,11 @@
 
 	switch (base) {
 	case TIME_UTC:
-		if (clock_gettime(CLOCK_REALTIME, ts) != 0)
+		if (clock_gettime(CLOCK_REALTIME, ts) == -1)
 			return 0;
+		break;
+	default:
+		return 0;
 	}
 
 	return base;