Thread fork führt zu falschem return code (5 answers)
Opened by TobEx at 2011-11-28 16:14

pq
 2011-11-28 23:05
#154524 #154524
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
siehe perldoc -f system:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
               If you'd like to manually inspect "system"'s failure, you can check
all possible failure modes by inspecting $? like this:

if ($? == -1) {
print "failed to execute: $!\n";
}
elsif ($? & 127) {
printf "child died with signal %d, %s coredump\n",
($? & 127), ($? & 128) ? 'with' : 'without';
}
else {
printf "child exited with value %d\n", $? >> 8;
}

wenn du $? >> 8 ausgibst, bekommst du die 2.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread fork führt zu falschem return code