Module Name: src
Committed By: christos
Date: Tue Oct 4 12:48:15 UTC 2016
Modified Files:
src/lib/libc/gen: timespec_get.c
Log Message:
return 0 on unsupported bases.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/gen/timespec_get.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/gen/timespec_get.c
diff -u src/lib/libc/gen/timespec_get.c:1.1 src/lib/libc/gen/timespec_get.c:1.2
--- src/lib/libc/gen/timespec_get.c:1.1 Tue Oct 4 05:41:41 2016
+++ src/lib/libc/gen/timespec_get.c Tue Oct 4 08:48:15 2016
@@ -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 @@ timespec_get(struct timespec *ts, int ba
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;