diff options
author | Gary E. Miller <gem@rellim.com> | 2018-12-14 13:38:43 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-12-14 13:38:43 -0800 |
commit | 3c99b28ee58a3e5c74507d65d448fbff4e509f30 (patch) | |
tree | a6629a15a507fb7a186074a14f285357b152fa7a | |
parent | 5a84936789309aba75aaa61000cfe1c541e22d2b (diff) | |
download | gpsd-3c99b28ee58a3e5c74507d65d448fbff4e509f30.tar.gz |
gpspipe: Change gmtime() to gmtime_r().
Some code checkers complain that gmtime() is not thread safe. Like
we care in gpspipe.
-rw-r--r-- | gpspipe.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -361,12 +361,12 @@ int main(int argc, char **argv) if (new_line && timestamp) { char tmstr_u[40]; // time with "usec" resolution struct timespec now; - struct tm *tmp_now; + struct tm tmp_now; int written; (void)clock_gettime(CLOCK_REALTIME, &now); - tmp_now = gmtime((time_t *)&(now.tv_sec)); - (void)strftime(tmstr, sizeof(tmstr), format, tmp_now); + (void)gmtime_r((time_t *)&(now.tv_sec), &tmp_now); + (void)strftime(tmstr, sizeof(tmstr), format, &tmp_now); new_line = 0; switch( option_u ) { |