chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
locale: unify some code between fedora and altlinux
[elogind.git]
/
src
/
sysctl.c
diff --git
a/src/sysctl.c
b/src/sysctl.c
index c57210e28dbf281173d8801faf770a73c5c32b6b..a8a9422ac35a9192a23af62d22b2800c6ea9430e 100644
(file)
--- a/
src/sysctl.c
+++ b/
src/sysctl.c
@@
-43,6
+43,7
@@
static void apply_sysctl(const char *property, const char *value) {
if (!(p = new(char, sizeof(PROC_SYS_PREFIX) + strlen(property)))) {
log_error("Out of memory");
exit_code = -ENOMEM;
if (!(p = new(char, sizeof(PROC_SYS_PREFIX) + strlen(property)))) {
log_error("Out of memory");
exit_code = -ENOMEM;
+ return;
}
n = stpcpy(p, PROC_SYS_PREFIX);
}
n = stpcpy(p, PROC_SYS_PREFIX);
@@
-53,8
+54,12
@@
static void apply_sysctl(const char *property, const char *value) {
*n = '/';
if ((r = write_one_line_file(p, value)) < 0) {
*n = '/';
if ((r = write_one_line_file(p, value)) < 0) {
- log_warning("Failed to write '%s' to '%s': %s", value, p, strerror(-r));
- exit_code = r;
+
+ log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING,
+ "Failed to write '%s' to '%s': %s", value, p, strerror(-r));
+
+ if (r != -ENOENT)
+ exit_code = r;
}
free(p);
}
free(p);