DRAFT lib/m2: SYS_gettimeofday expects pointers.
* lib/m2/time.c (time): Pass address of parameters, use `.' instead of `->' for member selection.
This commit is contained in:
parent
f92727fba9
commit
3d1dcc3971
|
@ -1,6 +1,7 @@
|
||||||
/* -*-comment-start: "//";comment-end:""-*-
|
/* -*-comment-start: "//";comment-end:""-*-
|
||||||
* GNU Mes --- Maxwell Equations of Software
|
* GNU Mes --- Maxwell Equations of Software
|
||||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||||
|
* Copyright © 2023 Meghan Denny <hello@nektro.net>
|
||||||
*
|
*
|
||||||
* This file is part of GNU Mes.
|
* This file is part of GNU Mes.
|
||||||
*
|
*
|
||||||
|
@ -28,10 +29,10 @@ time (long* result)
|
||||||
int r;
|
int r;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct timezone tz;
|
struct timezone tz;
|
||||||
r = _sys_call2 (SYS_gettimeofday, tv, tz);
|
r = _sys_call2 (SYS_gettimeofday, &tv, &tz);
|
||||||
if (r != 0)
|
if (r != 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
result[0] = tv->tv_sec;
|
result[0] = tv.tv_sec;
|
||||||
return tv->tv_sec;
|
return tv.tv_sec;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue