File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
jerry-libc/target/mcu-stubs Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 65
65
gettimeofday (void * tp __attr_unused___ , /**< struct timeval */
66
66
void * tzp __attr_unused___ ) /**< struct timezone */
67
67
{
68
- return 0 ;
68
+ return -1 ;
69
69
} /* gettimeofday */
Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ bool jerry_port_get_time_zone (jerry_time_zone_t *tz_p)
32
32
tz .tz_minuteswest = 0 ;
33
33
tz .tz_dsttime = 0 ;
34
34
35
- gettimeofday (& tv , & tz );
35
+ if (gettimeofday (& tv , & tz ) != 0 )
36
+ {
37
+ return false;
38
+ }
36
39
37
40
tz_p -> offset = tz .tz_minuteswest ;
38
41
tz_p -> daylight_saving_time = tz .tz_dsttime > 0 ? 1 : 0 ;
@@ -47,7 +50,10 @@ double jerry_port_get_current_time ()
47
50
{
48
51
struct timeval tv ;
49
52
50
- gettimeofday (& tv , NULL );
53
+ if (gettimeofday (& tv , NULL ) != 0 )
54
+ {
55
+ return 0 ;
56
+ }
51
57
52
58
return ((double ) tv .tv_sec ) * 1000.0 + ((double ) tv .tv_usec ) / 1000.0 ;
53
59
} /* jerry_port_get_current_time */
You can’t perform that action at this time.
0 commit comments