Skip to content

glib: Don’t use time(NULL) to get current time

Philip Withnall requested to merge pwithnall/glib:1402-real-time into master

Use either g_get_real_time() or g_date_time_new_now_local(). This means we don’t need to worry about time_t being 32b in future (the year 2038 problem), and it makes the need for error handling a bit more explicit. Improve the error handling in several cases.

Based on a patch by Niels De Graef (!142 (closed)).

Signed-off-by: Philip Withnall withnall@endlessm.com

#1402 (closed)

Closes #1402 (closed)

Merge request reports