bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

.SHELLSTATUS not set correctly when $(shell ...) terminated by signal


From: Troy Runkel
Subject: .SHELLSTATUS not set correctly when $(shell ...) terminated by signal
Date: Tue, 21 Mar 2017 13:59:49 +0000

It looks like the value of .SHELLSTATUS is not always set correctly when the $(shell …) command is terminated by a signal. 

 

Here’s a Makefile which demonstrates this behavior:

 

STDOUT := $(shell kill -s SEGV $$$$)

$(info status=$(.SHELLSTATUS) stdout="$(STDOUT)")

$(error Stop)

 

I ran this Makefile on Debian 8 Linux using gmake 4.2.1 and got the following output:

 

$ gmake

status=0 stdout=" "

Makefile:3: *** Stop.  Stop.

 

I would have expected behavior similar to what happens when a recipe is interrupted by a signal, where gmake receives a non-zero exit value from the recipe.

 

Is this the expected behavior of .SHELLSTATUS in this use case?

 

Thanks!

 

Troy Runkel

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]