Skip to content

Commit

Permalink
include the case where runstate is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sgerwk authored and t8m committed Nov 1, 2021
1 parent cba1f87 commit 410e9e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ AS_IF([test "$enable_anacron" != no && test "$have_obstack" = no], [
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/obstack"
])

AM_CONDITIONAL(HAS_RUNSTATE, [test x$runstatedir != x])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

11 changes: 9 additions & 2 deletions src/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ src_crontab_LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
# Depends on this Makefile, because it uses make variables.
# CCD 2010/09/10 added CRON_HOSTNAME for clustered-cron.
CLEANFILES += cron-paths.h
if HAS_RUNSTATE
cronpidcomment=/* directory of cron pid file */
cronpiddir=\#define CRON_PID_DIR "$(runstatedir)"
else
cronpidcomment=
cronpiddir=
endif
cron-paths.h: Makefile
@echo 'creating $@'
@sed >$@ 's/ *\\$$//' <<\END #\
Expand Down Expand Up @@ -96,8 +103,8 @@ cron-paths.h: Makefile
#define CRON_ALLOW "$(sysconfdir)/cron.allow" \
#define CRON_DENY "$(sysconfdir)/cron.deny" \
\
/* directory of cron pid file */ \
#define CRON_PID_DIR "$(runstatedir)" \
$(cronpidcomment) \
$(cronpiddir) \
\
/* 4.3BSD-style crontab f.e. /etc/crontab */ \
#define SYSCRONTAB "$(SYSCRONTAB)" \
Expand Down

0 comments on commit 410e9e3

Please # to comment.