diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-02-16 20:04:19 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-02-16 20:04:19 +0100 |
| commit | dc207f669675a271812a21b0ddbe3b894adf8e4c (patch) | |
| tree | 6d68282fa379fd778f7621ecb59450bfc85996e4 /networking/udhcp/signalpipe.c | |
| parent | 5b3b468ec0c6e6dfe772722dbd6b2c57cef817b5 (diff) | |
| download | busybox-w32-dc207f669675a271812a21b0ddbe3b894adf8e4c.tar.gz busybox-w32-dc207f669675a271812a21b0ddbe3b894adf8e4c.tar.bz2 busybox-w32-dc207f669675a271812a21b0ddbe3b894adf8e4c.zip | |
udhcp: do not clobber errno by signal handler
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/signalpipe.c')
| -rw-r--r-- | networking/udhcp/signalpipe.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/networking/udhcp/signalpipe.c b/networking/udhcp/signalpipe.c index 6355c5e90..30bccd6bf 100644 --- a/networking/udhcp/signalpipe.c +++ b/networking/udhcp/signalpipe.c | |||
| @@ -25,9 +25,11 @@ static struct fd_pair signal_pipe; | |||
| 25 | 25 | ||
| 26 | static void signal_handler(int sig) | 26 | static void signal_handler(int sig) |
| 27 | { | 27 | { |
| 28 | int sv = errno; | ||
| 28 | unsigned char ch = sig; /* use char, avoid dealing with partial writes */ | 29 | unsigned char ch = sig; /* use char, avoid dealing with partial writes */ |
| 29 | if (write(signal_pipe.wr, &ch, 1) != 1) | 30 | if (write(signal_pipe.wr, &ch, 1) != 1) |
| 30 | bb_perror_msg("can't send signal"); | 31 | bb_perror_msg("can't send signal"); |
| 32 | errno = sv; | ||
| 31 | } | 33 | } |
| 32 | 34 | ||
| 33 | /* Call this before doing anything else. Sets up the socket pair | 35 | /* Call this before doing anything else. Sets up the socket pair |
