diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-07-30 14:54:31 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-07-30 14:54:31 +0200 |
commit | d19a87a0b2d6c8a282a04ef80bee5a3b9f4547a1 (patch) | |
tree | edefb0359c8eaf1792438aefd05dff2e202bb1ee | |
parent | 9b0949b728eae42550e5adc6ff67063499d53044 (diff) |
sock: Avoid setting negative socket memory values
When getting of the initial values fails in set_system_socket_memory(),
we store -1 for the values. Avoid writing these back (and causing an
error message) when calling reset_system_socket_memory().
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | sock.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -168,7 +168,7 @@ static int get_system_socket_mem(int which) static void set_system_socket_mem(int which, int val) { - if (sysctl_set_int(sock_mem[which], val)) + if (val > 0 && sysctl_set_int(sock_mem[which], val)) printf("Cannot set system socket memory in %s%s: %s\n", SYSCTL_PROC_PATH, sock_mem[which], strerror(errno)); } |