summaryrefslogtreecommitdiffstats
path: root/signals.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-07 10:42:30 +0000
committerRoy Marples <roy@marples.name>2007-11-07 10:42:30 +0000
commitee3485fe1026fd9a28c71977a71fa2589fb8ae35 (patch)
treeaa84ba81e7bfae1e3be24ce221f3df78c5dec934 /signals.c
parentde8a9d9887e862c9fefc9b6ff3520c572a57b924 (diff)
downloaddhcpcd-ee3485fe1026fd9a28c71977a71fa2589fb8ae35.tar.xz
Actually read the signal from the buffer
Diffstat (limited to 'signals.c')
-rw-r--r--signals.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/signals.c b/signals.c
index bb36cf6c..81829c9b 100644
--- a/signals.c
+++ b/signals.c
@@ -112,6 +112,9 @@ int signal_read (fd_set *rfds)
memset (buf, 0, buflen);
bytes = read (signal_pipe[0], buf, buflen);
+ if (bytes >= sizeof (sig))
+ memcpy (&sig, buf, sizeof (sig));
+
/* We need to clear us from rfds if nothing left in the buffer
* in case we are called many times */
if (bytes == sizeof (sig))