]> the.earth.li Git - autodns.git/commitdiff
cscvs to tla changeset 9
authorJonathan McDowell <noodles@earth.li>
Wed, 15 Jun 2005 10:41:54 +0000 (10:41 +0000)
committerJonathan McDowell <noodles@earth.li>
Wed, 15 Jun 2005 10:41:54 +0000 (10:41 +0000)
Author: noodles
Date: 2005/04/13 17:24:40
Add wait for gpg termination signal.

git-archimport-id: noodles@earth.li--pie/autodns--mainline--1.0--patch-8

autodns.pl

index f84300fee11d88d4155bdb9417a72bf5fdf1352a..8e1e20bbfc8c105119adb0422daf14be61031db8 100755 (executable)
@@ -5,7 +5,7 @@
 # http://www.earth.li/projectpurple/progs/autodns.html
 # Released under the GPL.
 #
-# $Id: autodns.pl,v 1.8 2005/04/08 13:51:13 noodles Exp $
+# $Id: autodns.pl,v 1.9 2005/04/13 17:24:40 noodles Exp $
 #
 
 use strict;
@@ -230,7 +230,8 @@ if ($entity->parts) {
        }
 
        if ($got_sig && $got_text) {
-               open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch --verify ".
+               my $pid = open3(\*GPGIN, \*GPGOUT, \*GPGERR,
+                       "gpg --batch --verify ".
                        $sig_name." ".$text_name);
 
                close GPGIN;
@@ -239,6 +240,7 @@ if ($entity->parts) {
                my @GPGOUTPUT=<GPGOUT>;
                close GPGERR;
                close GPGOUT;
+               waitpid $pid, 0;
 
                unlink($text_name);
                unlink($sig_name);
@@ -246,7 +248,7 @@ if ($entity->parts) {
 } else {
        # Clear text.
 
-       open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch");
+       my $pid = open3(\*GPGIN, \*GPGOUT, \*GPGERR, "gpg --batch");
 
        # Feed it the mail.
        print GPGIN @MAIL;
@@ -257,6 +259,7 @@ if ($entity->parts) {
        @COMMANDS=<GPGOUT>;
        close GPGERR;
        close GPGOUT;
+       waitpid $pid, 0;
 }
 
 # Check who it's from and if the signature was a good one.