Source-Changes-HG archive

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

[src/trunk]: src/libexec/httpd/small bozohttpd-small: fix error handling for ...



details:   https://anonhg.NetBSD.org/src/rev/7ff4abbd9e7b
branches:  trunk
changeset: 961059:7ff4abbd9e7b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Apr 08 06:44:55 2021 +0000

description:
bozohttpd-small: fix error handling for unifdef

The second of the '$$?' was spelled only '$?'.  At the time where this
shell expression was evaluated, it had already been overwritten by the
preceding command '['.

diffstat:

 libexec/httpd/small/Makefile |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r e90d8f739983 -r 7ff4abbd9e7b libexec/httpd/small/Makefile
--- a/libexec/httpd/small/Makefile      Thu Apr 08 06:20:47 2021 +0000
+++ b/libexec/httpd/small/Makefile      Thu Apr 08 06:44:55 2021 +0000
@@ -14,13 +14,21 @@
 CFLAGS=        -I$(.CURDIR)/.. ${LEAN_IFDEF_FLAGS}
 
 bozohttpd-small.c: bozohttpd.c
-       unifdef $(LEAN_IFDEF_FLAGS) < $> > $@.tmp ;\
-       if [ $$? -ne 1 ]; then echo "unifdef returned $?, expecting 1" 2>&1; false; fi
+       unifdef $(LEAN_IFDEF_FLAGS) < $> > $@.tmp;                      \
+       status=$$?;                                                     \
+       if [ $$status -ne 1 ]; then                                     \
+               echo "unifdef returned $$status, expecting 1" 2>&1;     \
+               false;                                                  \
+       fi
        mv -f $@.tmp $@
 
 content-bozo-small.c: content-bozo.c
-       unifdef $(LEAN_IFDEF_FLAGS) < $> > $@.tmp ;\
-       if [ $$? -ne 1 ]; then echo "unifdef returned $?, expecting 1" 2>&1; false; fi
+       unifdef $(LEAN_IFDEF_FLAGS) < $> > $@.tmp;                      \
+       status=$$?;                                                     \
+       if [ $$status -ne 1 ]; then                                     \
+               echo "unifdef returned $$status, expecting 1" 2>&1;     \
+               false;                                                  \
+       fi
        mv -f $@.tmp $@
 
 CLEANFILES+=   content-bozo-small.c bozohttpd-small.c



Home | Main Index | Thread Index | Old Index