usign-exec: close writing end of pipe early in parent process
[oweals/ucert.git] / usign-exec.c
index c9aecf99f9c05965157b92732bdd865391c01ab4..0dde81ed647b94a382044d97695fe25b497a4443 100644 (file)
@@ -136,6 +136,8 @@ static int usign_f(char fingerprint[17], const char *pubkeyfile, const char *sec
                _exit(1);
        }
 
+       close(fds[1]);
+
        waitpid(pid, &status, 0);
        status = WEXITSTATUS(status);
        if (fingerprint && !WEXITSTATUS(status)) {
@@ -149,7 +151,6 @@ static int usign_f(char fingerprint[17], const char *pubkeyfile, const char *sec
 
        }
        close(fds[0]);
-       close(fds[1]);
        return status;
 }