[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Wed Jun 9 19:20:18 CEST 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/06/09 19:20:18

Modified files:
	cm3/m3-libs/m3core/src/unix/Common/: Uexec.c 

Log message:
	Only call WEXITSTATUS if WIFEXITED.
	Only call WTERMSIG if WIFSIGNALED.
	Otherwise we get -1 and a subrange violation on OSF/1, due to:
	/* evaluates to the low-order 8 bits of the child exit status	*/
	#define WEXITSTATUS(x)	(WIFEXITED(x) ? ((_W_INT(x) >> 8) & 0377) : -1)
	/* evaluates to a non-zero value if status returned for abnormal termination */
	#define WIFSIGNALED(x)	(_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
	/* evaluates to the number of the signal that caused the child to terminate */
	#define WTERMSIG(x)	(WIFSIGNALED(x) ? _WSTATUS(x) : -1)
	
	and a careful read of Posix validates this change.
	They don't say what WEXITSTATUS and WTERMSIG do if WIFEXITED, WIFSIGNALED
	are false, only if true.




More information about the M3commit mailing list