From 3a88903282b5c905faff4a22e752a2a03d84c25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 7 Nov 2004 01:16:12 +0000 Subject: [PATCH] _kern_set_real_time_clock now returns a status, we now use it for errno git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9818 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/posix/time/stime.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/kernel/libroot/posix/time/stime.c b/src/kernel/libroot/posix/time/stime.c index 334365e3eb..1d7105a184 100644 --- a/src/kernel/libroot/posix/time/stime.c +++ b/src/kernel/libroot/posix/time/stime.c @@ -4,14 +4,16 @@ */ #include -#include #include +#include "syscalls.h" // ToDo: replace zero by a ROOT_UID when usergroup.c is implemented int stime(const time_t *tp) { + status_t status; + if (tp == NULL) { errno = EINVAL; return -1; @@ -20,7 +22,11 @@ stime(const time_t *tp) errno = EPERM; return -1; } - set_real_time_clock(*tp); - return B_OK; + status = _kern_set_real_time_clock(*tp); + if (status < B_OK) { + errno = status; + return -1; + } + return 0; }