This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11586] New: after call sigaction
- From: "weikun at caltech dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2003 00:02:06 -0000
- Subject: [Bug c/11586] New: after call sigaction
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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);
> }
>