static void memcleanup_send_broadcast(struct storage_config_info *info, enum memnoti_level level, enum memnoti_level prev_level)
{
time_t t;
- struct tm *timeinfo;
+ struct tm timeinfo;
enum tzplatform_variable path;
char *value;
char buf[20];
write_file();
t = time(NULL);
- timeinfo = localtime(&t);
- strftime(buf, sizeof(buf), "%b %d %T", timeinfo);
+ if (localtime_r(&t, &timeinfo) == NULL) {
+ _E("Failed to localtime_r");
+ goto out;
+ }
+
+ strftime(buf, sizeof(buf), "%b %d %T", &timeinfo);
_D("time: %s path: %d level: %s", buf, path, value);
+out:
dbus_handle_broadcast_dbus_signal_var(STORAGED_PATH_LOWMEM, STORAGED_INTERFACE_LOWMEM,
SIGNAL_NEED_CLEANUP, g_variant_new("(is)", path, value));