From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26083 invoked by alias); 19 Jul 2003 00:02:07 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26055 invoked by uid 48); 19 Jul 2003 00:02:06 -0000 Date: Sat, 19 Jul 2003 00:02:00 -0000 From: "weikun at caltech dot edu" To: gcc-bugs@gcc.gnu.org Message-ID: <20030719000203.11586.weikun@caltech.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/11586] New: after call sigaction X-Bugzilla-Reason: CC X-SW-Source: 2003-07/txt/msg02228.txt.bz2 List-Id: 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 > > 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); > } >