summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-07-30 14:38:25 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-07-30 14:38:25 +0200
commit9b0949b728eae42550e5adc6ff67063499d53044 (patch)
treeff828ad0fc1fe22c38b863b1c8e102e1bf55c377
parent20e2a6a9b199a1a54bd53f62f29003eb4f5bec6b (diff)
sock: Don't panic() when sysctl_set_int fails
Instead print an error message including some more details. netsniff-ng should still remain funcional without the socket sysctl values being set. Suggested-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--sock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sock.c b/sock.c
index 84723d0..10199a4 100644
--- a/sock.c
+++ b/sock.c
@@ -169,7 +169,8 @@ 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))
- panic("Cannot set system socket memory!\n");
+ printf("Cannot set system socket memory in %s%s: %s\n",
+ SYSCTL_PROC_PATH, sock_mem[which], strerror(errno));
}
void set_system_socket_memory(int *vals, size_t len)