system() always returns 0?

Derek E. Terveer det at hawkmoon.MN.ORG
Sat Jan 21 15:56:44 AEST 1989


Has anyone encountered a problem with the Microsoft C 5.0 compiler always
returning a 0 from the system() call, no matter what the actual command
executed by system() returns?

Is there a fix for this or am i misunderstanding something fundamental about
the way the system() call works in msc5.0?  (Like the command.com always
returning the 0, which system(), in turn, returns to my program?)

I'm trying to determine whether or not the executed command succeeded or not by
looking at the completion code from system, ala:

	char buf[BUFSIZ];

	sprintf(buf,"rnews < D_elricf.3aa");
	if (!system(buf)) perror(buf);

and i'm having a hard time of it since system() always (seems) to return 0!

derek
-- 
Derek Terveer 	    det at hawkmoon.MN.ORG || ..!uunet!rosevax!elric!hawkmoon!det
		    w(612)681-6986   h(612)688-0667

"A proper king is crowned" -- Thomas B. Costain



More information about the Comp.lang.c mailing list