Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > How to call system having trap("CHLD", "IGNORE")?

Reply
Thread Tools

How to call system having trap("CHLD", "IGNORE")?

 
 
Pavel Smerk
Guest
Posts: n/a
 
      07-17-2006
Hi all,

doing some forks I want to ignore SIGCHLD. But

trap("CHLD", "IGNORE")
system "echo"

ends in ruby 1.8.2 (2005-04-11) [i386-linux] with a following error:

in `system': no implicit conversion from nil to integer (TypeError)

Where I am wrong?

Thanks,

P.
 
Reply With Quote
 
 
 
 
ara.t.howard@noaa.gov
Guest
Posts: n/a
 
      07-17-2006
On Tue, 18 Jul 2006, Pavel Smerk wrote:

> Hi all,
>
> doing some forks I want to ignore SIGCHLD. But
>
> trap("CHLD", "IGNORE")
> system "echo"
>
> ends in ruby 1.8.2 (2005-04-11) [i386-linux] with a following error:
>
> in `system': no implicit conversion from nil to integer (TypeError)
>
> Where I am wrong?
>
> Thanks,
>
> P.


it looks like a bug.

try

trap('SIGCHLD'){ nil }

-a
--
suffering increases your inner strength. also, the wishing for suffering
makes the suffering disappear.
- h.h. the 14th dali lama

 
Reply With Quote
 
 
 
 
Yukihiro Matsumoto
Guest
Posts: n/a
 
      07-18-2006
Hi,

In message "Re: How to call system having trap("CHLD", "IGNORE")?"
on Tue, 18 Jul 2006 03:05:07 +0900, Pavel Smerk <(E-Mail Removed)> writes:

|doing some forks I want to ignore SIGCHLD. But
|
|trap("CHLD", "IGNORE")
|system "echo"
|
|ends in ruby 1.8.2 (2005-04-11) [i386-linux] with a following error:
|
|in `system': no implicit conversion from nil to integer (TypeError)
|
|Where I am wrong?

system() tried to pick up the exit status of forked sub-process.
Since you've set SIG_IGN sub-process disappeared without notice to
wait(2) system call, which failed and caused an error you've seen.
What did you try to accomplish by ignoring SIGCHLD?

It is fairly easy to make system to ignore wait(2) error, but I am not
sure it is the way to go.

matz.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: Help replacing os.system call with subprocess call David Pratt Python 0 04-07-2008 01:38 PM
Help replacing os.system call with subprocess call David Pratt Python 0 04-07-2008 05:32 AM
System call and library call leoman730 C++ 6 05-06-2007 12:37 AM
system call and library call rahul8143@gmail.com C Programming 7 08-23-2005 01:24 PM



Advertisments