public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11586] New: after call sigaction
@ 2003-07-19  0:02 weikun at caltech dot edu
  2003-07-19  0:05 ` [Bug c/11586] after call sigaction, system() return wrong status weikun at caltech dot edu
  2003-07-19  0:07 ` pinskia at physics dot uc dot edu
  0 siblings, 2 replies; 5+ messages in thread
From: weikun at caltech dot edu @ 2003-07-19  0:02 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11586

           Summary: after call sigaction
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: weikun at caltech dot edu
                CC: gcc-bugs at gcc dot gnu dot org

I notice since gcc 3, the return value of system() doesn't work correctly. The 
following code will print out return 0 or -1 randomly, please help me how to 
solve this problem because I need to check if return value is 0 or -1 to make 
sure  system call is fine or not.

It happens since RH9, and it works fine before with all the previous verion 
RedHat.

> #include <signal.h>
> 
> main()
> {
>         struct sigaction v_sig;
> 
>         #if !defined(linux)
>                 v_sig.sa_flags =  SA_NOCLDWAIT;
>         #else
>                 v_sig.sa_handler = SIG_IGN;
>         #endif
> 
>         sigaction(SIGCHLD, &v_sig, 0);
> 
>         printf("return %d\n", system("ls -l > /dev/null"));
> 
>         return (0);
> }
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-26 21:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-11586-4@http.gcc.gnu.org/bugzilla/>
2012-05-15 15:19 ` [Bug c/11586] after call sigaction, system() return wrong status paolo at gcc dot gnu.org
2012-05-15 15:27 ` paolo.carlini at oracle dot com
2014-02-26 21:28 ` jason at gcc dot gnu.org
2003-07-19  0:02 [Bug c/11586] New: after call sigaction weikun at caltech dot edu
2003-07-19  0:05 ` [Bug c/11586] after call sigaction, system() return wrong status weikun at caltech dot edu
2003-07-19  0:07 ` pinskia at physics dot uc dot edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).