Codebase list krb5-sync / 3694417
Fix a few bugs in the new silent support. Russ Allbery 16 years ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
2424 ##############################################################################
2525
2626 use strict;
27 use Getopt::Long qw(GetOptions);
2728 use Fcntl qw(LOCK_EX O_WRONLY O_CREAT O_EXCL);
2829 use POSIX qw(EEXIST);
2930
168169 if (not defined $pid) {
169170 die "$0: cannot fork: $!\n";
170171 } elsif ($pid == 0) {
171 unless ($silent) {
172 if ($silent) {
172173 open (STDERR, '>&STDOUT') or die "$0: cannot dup STDOUT: $!\n";
173174 }
174175 exec ($SYNC, '-f', $file) or die "$0: cannot exec $SYNC: $!\n";
181182 $ignore = 1 if $output =~ /$regex/;
182183 }
183184 if (not $silent) {
184 print $output;
185 print $output if $output;
186 warn "$0: krb5-sync failed on $file\n" unless $? == 0;
185187 } elsif (not $ignore and $? != 0) {
186188 warn $output;
187 warn "$0: krb5-sync failed on $file\n" unless ($? == 0);
189 warn "$0: krb5-sync failed on $file\n";
188190 }
189191 unless ($? == 0) {
190192 $skipped{$id} = 1;