]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/passprompt.c
pppd: Handle SIGINT and SIGTERM during interrupted syscalls (#148)
[ppp.git] / pppd / plugins / passprompt.c
index babb6dc31bab6f1d71d1cabedfd844ba2a4d5158..44e381501fdd6eeb8e02148ddb892cdde5384198 100644 (file)
@@ -74,7 +74,7 @@ static int promptpass(char *user, char *passwd)
        if (red == 0)
            break;
        if (red < 0) {
-           if (errno == EINTR)
+           if (errno == EINTR && !got_sigterm)
                continue;
            error("Can't read secret from %s: %m", promptprog);
            readgood = -1;
@@ -86,7 +86,7 @@ static int promptpass(char *user, char *passwd)
 
     /* now wait for child to exit */
     while (waitpid(kid, &wstat, 0) < 0) {
-       if (errno != EINTR) {
+       if (errno != EINTR || got_sigterm) {
            warn("error waiting for %s: %m", promptprog);
            break;
        }