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/02f458c3a973
branches:  trunk
changeset: 982290:02f458c3a973
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 b93ef2671262 -r 02f458c3a973 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