summaryrefslogtreecommitdiff
path: root/pppd/utils.c
diff options
context:
space:
mode:
authorpali <7141871+pali@users.noreply.github.com>2020-05-25 07:35:55 +0200
committerGitHub <noreply@github.com>2020-05-25 15:35:55 +1000
commitc319558b8cacad7d27f04c7d612e44b67f273434 (patch)
treed84665ff78c0b84d604eadc256bb1eb10789da55 /pppd/utils.c
parent0bc11fba4e57d6fabfdce20bef07d4dd4d6ef38c (diff)
downloadppp-c319558b8cacad7d27f04c7d612e44b67f273434.tar.gz
pppd: Handle SIGINT and SIGTERM during interrupted syscalls (#148)
When pppd receives SIGINT or SIGTERM it should handle it and not try to restart interrupted syscall. This change fixes problem that pppd cannot be terminated by SIGINT or SIGTERM signal when pppd plugins are used. Signed-off-by: Pali Rohár <pali@kernel.org>
Diffstat (limited to 'pppd/utils.c')
-rw-r--r--pppd/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pppd/utils.c b/pppd/utils.c
index 3602aa6..23189d0 100644
--- a/pppd/utils.c
+++ b/pppd/utils.c
@@ -835,7 +835,7 @@ complete_read(int fd, void *buf, size_t count)
for (done = 0; done < count; ) {
nb = read(fd, ptr, count - done);
if (nb < 0) {
- if (errno == EINTR)
+ if (errno == EINTR && !got_sigterm)
continue;
return -1;
}