projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5035911
)
locale-setup: make failure in stat() critical
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Tue, 13 Dec 2022 09:02:57 +0000
(18:02 +0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Wed, 14 Dec 2022 11:18:58 +0000
(20:18 +0900)
The file was created by this function. Hence, the failure is something
critical.
src/shared/locale-setup.c
patch
|
blob
|
history
diff --git
a/src/shared/locale-setup.c
b/src/shared/locale-setup.c
index 1b85ec41358aaf78109130298ea4173cb53f583b..cd994cffb7da7fdfd0d5340f4fe275384b8e8c92 100644
(file)
--- a/
src/shared/locale-setup.c
+++ b/
src/shared/locale-setup.c
@@
-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);