locale-setup: make failure in stat() critical

The file was created by this function. Hence, the failure is something
critical.
This commit is contained in:
Yu Watanabe
2022-12-14 20:18:58 +09:00
parent 50359113e9
commit 00afa6a38f
+4 -2
View File
@@ -208,8 +208,10 @@ int locale_context_save(LocaleContext *c, char ***ret_set, char ***ret_unset) {
if (r < 0)
return r;
if (stat("/etc/locale.conf", &st) >= 0)
c->mtime = timespec_load(&st.st_mtim);
if (stat("/etc/locale.conf", &st) < 0)
return -errno;
c->mtime = timespec_load(&st.st_mtim);
if (ret_set)
*ret_set = TAKE_PTR(set);