diff --git a/docs/cookbook/c/clean.do b/docs/cookbook/c/clean.do new file mode 100644 index 0000000..4b7488c --- /dev/null +++ b/docs/cookbook/c/clean.do @@ -0,0 +1,2 @@ +rm -rf out out.* +rm -f *~ .*~ */*~ */.*~ sources arches allconfig when.c diff --git a/docs/cookbook/c/rc/posix.rc.od b/docs/cookbook/c/rc/posix.rc.od index 546fc8a..4a6b172 100644 --- a/docs/cookbook/c/rc/posix.rc.od +++ b/docs/cookbook/c/rc/posix.rc.od @@ -8,9 +8,13 @@ struct timespec x; ' x= +rc_replaceln HAS_POSIX 1 if ! rc_compile cc link "$prog"; then - x="-D_XOPEN_SOURCE=500" - rc_appendln CPPFLAGS "$x" - rc_compile cc link "$prog" + x="-D_XOPEN_SOURCE=500" + rc_appendln CPPFLAGS "$x" + if ! rc_compile cc link "$prog"; then + rc_undo + rc_replaceln HAS_POSIX "" + fi fi rc_save diff --git a/redoconf/rc.sh b/redoconf/rc.sh index bc2fa4d..2163a15 100644 --- a/redoconf/rc.sh +++ b/redoconf/rc.sh @@ -15,7 +15,7 @@ _rc_exit_check() { echo "Fatal: used redoconf/rc.sh but didn't call rc_include." >&2 exit 91 elif [ -n "$RC_QUEUE" ]; then - echo "Fatal: must call rc_save or rc_undo before ending." >&2 + echo "Fatal: script exited without rc_save or rc_undo." >&2 exit 92 fi }