_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
This commit is contained in:
@@ -4,14 +4,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <OS.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include "syscalls.h"
|
||||||
|
|
||||||
// ToDo: replace zero by a ROOT_UID when usergroup.c is implemented
|
// ToDo: replace zero by a ROOT_UID when usergroup.c is implemented
|
||||||
|
|
||||||
int
|
int
|
||||||
stime(const time_t *tp)
|
stime(const time_t *tp)
|
||||||
{
|
{
|
||||||
|
status_t status;
|
||||||
|
|
||||||
if (tp == NULL) {
|
if (tp == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -20,7 +22,11 @@ stime(const time_t *tp)
|
|||||||
errno = EPERM;
|
errno = EPERM;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
set_real_time_clock(*tp);
|
status = _kern_set_real_time_clock(*tp);
|
||||||
return B_OK;
|
if (status < B_OK) {
|
||||||
|
errno = status;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user