libposix: POSIX_gettimeofday fails without proper initialization
This commit is contained in:
parent
0185e3b4a1
commit
386cb370a6
|
@ -37,11 +37,15 @@ POSIX_gettimeofday(int *errnop, void *timeval, void *timezone)
|
||||||
t = localtime(time(nil));
|
t = localtime(time(nil));
|
||||||
|
|
||||||
if(timeval != nil){
|
if(timeval != nil){
|
||||||
|
if(__libposix_timeval_reader == nil)
|
||||||
|
sysfatal("libposix: uninitialzed timeval reader");
|
||||||
e = __libposix_timeval_reader(timeval, t);
|
e = __libposix_timeval_reader(timeval, t);
|
||||||
if(e != 0)
|
if(e != 0)
|
||||||
goto FailWithError;
|
goto FailWithError;
|
||||||
}
|
}
|
||||||
if(timezone != nil){
|
if(timezone != nil){
|
||||||
|
if(__libposix_timezone_reader == nil)
|
||||||
|
sysfatal("libposix: uninitialzed timezone reader");
|
||||||
e = __libposix_timezone_reader(timezone, t);
|
e = __libposix_timezone_reader(timezone, t);
|
||||||
if(e != 0)
|
if(e != 0)
|
||||||
goto FailWithError;
|
goto FailWithError;
|
||||||
|
|
Loading…
Reference in New Issue