Skip to content

Commit 876eb61

Browse files
committed
Merge branch 'jk/make-coccicheck-detect-errors'
Build fix. * jk/make-coccicheck-detect-errors: Makefile: detect errors in running spatch
2 parents e711824 + f5c2bc2 commit 876eb61

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,9 +2348,17 @@ check: common-cmds.h
23482348
C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
23492349
%.cocci.patch: %.cocci $(C_SOURCES)
23502350
@echo ' ' SPATCH $<; \
2351+
ret=0; \
23512352
for f in $(C_SOURCES); do \
2352-
$(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS); \
2353-
done >$@ 2>$@.log; \
2353+
$(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
2354+
{ ret=$$?; break; }; \
2355+
done >$@+ 2>$@.log; \
2356+
if test $$ret != 0; \
2357+
then \
2358+
cat $@.log; \
2359+
exit 1; \
2360+
fi; \
2361+
mv $@+ $@; \
23542362
if test -s $@; \
23552363
then \
23562364
echo ' ' SPATCH result: $@; \

0 commit comments

Comments
 (0)