sysctl: disable buffer while writing to /proc
fputs() writes only first 2048 bytes and fails to write to /proc when values are larger than that. This patch adds a new flag to WriteStringFileFlags that make it possible to disable the buffer under specific cases.
This commit is contained in:
@@ -60,7 +60,7 @@ int sysctl_write(const char *property, const char *value) {
|
||||
log_debug("Setting '%s' to '%s'", property, value);
|
||||
|
||||
p = strjoina("/proc/sys/", property);
|
||||
return write_string_file(p, value, 0);
|
||||
return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER);
|
||||
}
|
||||
|
||||
int sysctl_read(const char *property, char **content) {
|
||||
|
||||
Reference in New Issue
Block a user