public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Raj <raju@mailandnews.com>
To: fengxj <fengxiangjun@neusoft.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: system() return different value under 2.4.23 and 2.6.0-test11
Date: Thu, 04 Dec 2003 15:51:09 +0530	[thread overview]
Message-ID: <3FCF0A95.3090302@mailandnews.com> (raw)
In-Reply-To: <00b801c3ba23$a3115670$1801010a@fengxj>

fengxj wrote:

>-----------------------------
>#include <stdio.h>
>#include <stdlib.h>
>#include <signal.h>
>
>int main(void)
>{
>        int ret;
>
>        signal(SIGCHLD, SIG_IGN);
>
>        ret = system("/bin/date 1>/dev/null");
>        printf("%d\n", ret);
>
>        return 0;
>}
>----------------------------
>
>runs under 2.4.23 with ret = 0,
>but under 2.6.0-test11, ret = -1.
>
>Why?
>
>And when i remove 
>    signal(...)
>it returns the same value 0. 
>  
>

It's happening because of the return values of wait4(). wait4() is
returning -1 in test11 whene SIGCHLD is SIG_IGN'ed.
/Raj


      reply	other threads:[~2003-12-04 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-04  5:01 system() return different value under 2.4.23 and 2.6.0-test11 fengxj
2003-12-04 10:21 ` Raj [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FCF0A95.3090302@mailandnews.com \
    --to=raju@mailandnews.com \
    --cc=fengxiangjun@neusoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox