wrong exitstatus returned?

F

Frank de Bot

Hi,

I have a perl script server which works with fork. But I got a problem
with executing commands from a child which handles a request. The
exitstatus $? is always -1 I've tried execute commands with system and
`command` but nothing matters.
What can be wrong?

Thanks in advanced,

Frank de bot
 
J

Joe Smith

Frank said:
I have a perl script server which works with fork. But I got a problem
with executing commands from a child which handles a request. The
exitstatus $? is always -1 I've tried execute commands with system and
`command` but nothing matters.

Linux?
Win32?
Win32 with cygwin?
 
F

Frank de Bot

Linux

I found out that $? won't function if the SIGCHLD handler is set, which
it is. I've found a very rude way to solve this problem by adding the
exit status via another script in front of the stdout of command I want
to run.
But I don't realy like this method, any suggestion?
 
A

Anno Siegel

[please don't top-post. lines rearranged]
Linux

I found out that $? won't function if the SIGCHLD handler is set, which
it is. I've found a very rude way to solve this problem by adding the
exit status via another script in front of the stdout of command I want
to run.
But I don't realy like this method, any suggestion?

If you have a handler, use it. See "perldoc -f waitpid".

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top