]> git.donarmstrong.com Git - bin.git/commitdiff
fix pipe wait logic
authorDon Armstrong <don@donarmstrong.com>
Mon, 24 Sep 2007 07:24:38 +0000 (07:24 +0000)
committerDon Armstrong <don@donarmstrong.com>
Mon, 24 Sep 2007 07:24:38 +0000 (07:24 +0000)
delay_mail

index 7f8a5b35e4d259e5bc89ef17cf7dae7b81a28676..d2b1553d4b050342ee3363667085d4090a755e62 100755 (executable)
@@ -179,11 +179,10 @@ if (exists $options{enqueue}) {
      print {$q_fh} "#####\n";
      print {$q_fh} $email;
      my $at_fh;
-     open($at_fh,'|-','at',$delay) or exit 1;
+     my $pid = open($at_fh,'|-','at',$delay) or exit 1;
      print {$at_fh} "$0 '--queue' '$options{queue}' '--process' '$queue_fn';\n";
-     close $at_fh;
-     waitpid(-1,0);
-     exit $?;
+     close $at_fh or exit $?
+     exit 0;
 }
 elsif ($options{list}) {
      my $dir = IO::Dir->new($options{queue}) or