summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <msweet@msweet.org>2020-11-14 09:58:12 -0500
committerMichael R Sweet <msweet@msweet.org>2020-11-14 09:58:12 -0500
commit9c1dcee087eee3c57937a223df76757a61dfd046 (patch)
tree617543802ebcacdb621dad6864cf0726c1ea4017
parent956623c7efe5dbbf7a95fed1089fc15a96c6d76f (diff)
Add --enable-sync-on-close configure option (Issue #37)
-rw-r--r--CHANGES-OPENPRINTING.md1
-rw-r--r--conf/cups-files.conf.in2
-rw-r--r--config-scripts/cups-defaults.m410
-rw-r--r--config.h.in7
-rwxr-xr-xconfigure17
-rw-r--r--man/cups-files.conf.53
-rw-r--r--scheduler/conf.c4
-rw-r--r--vcnet/config.h7
-rw-r--r--xcode/config.h7
9 files changed, 55 insertions, 3 deletions
diff --git a/CHANGES-OPENPRINTING.md b/CHANGES-OPENPRINTING.md
index f2f449961..8a7c79972 100644
--- a/CHANGES-OPENPRINTING.md
+++ b/CHANGES-OPENPRINTING.md
@@ -26,6 +26,7 @@ Changes in CUPS v2.3.3op1
- The scheduler no longer adds the local hostname to the ServerAlias list
(Issue #32)
- Added `--with-max-log-size` configure option (Issue #35)
+- Added `--enable-sync-on-close` configure option (Issue #37)
- Added `--with-error-policy` configure option (Issue #38)
- IPP Everywhere PPDs could have an "unknown" default InputSlot (Issue #44)
- The `httpAddrListen` function now uses a listen backlog of 128.
diff --git a/conf/cups-files.conf.in b/conf/cups-files.conf.in
index 4a78ba615..af11fcce6 100644
--- a/conf/cups-files.conf.in
+++ b/conf/cups-files.conf.in
@@ -7,7 +7,7 @@
#FatalErrors @CUPS_FATAL_ERRORS@
# Do we call fsync() after writing configuration or status files?
-#SyncOnClose No
+#SyncOnClose @CUPS_SYNC_ON_CLOSE@
# Default user and group for filters/backends/helper programs; this cannot be
# any user or group that resolves to ID 0 for security reasons...
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index b6051778d..df386b822 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -137,6 +137,16 @@ else
fi
AC_SUBST(CUPS_PAGE_LOG_FORMAT)
+dnl Default SyncOnClose
+AC_ARG_ENABLE(sync_on_close, [ --enable-sync-on-close enable SyncOnClose (off by default)])
+if test "x$enable_sync_on_close" = xyes; then
+ CUPS_SYNC_ON_CLOSE="Yes"
+ AC_DEFINE(CUPS_DEFAULT_SYNC_ON_CLOSE)
+else
+ CUPS_SYNC_ON_CLOSE="No"
+fi
+AC_SUBST(CUPS_SYNC_ON_CLOSE)
+
dnl Default Browsing
AC_ARG_ENABLE(browsing, [ --disable-browsing disable Browsing by default])
if test "x$enable_browsing" = xno; then
diff --git a/config.h.in b/config.h.in
index 6a197ecc5..6343e6dd0 100644
--- a/config.h.in
+++ b/config.h.in
@@ -102,6 +102,13 @@
/*
+ * Default SyncOnClose value...
+ */
+
+#undef CUPS_DEFAULT_SYNC_ON_CLOSE
+
+
+/*
* Do we have domain socket support, and if so what is the default one?
*/
diff --git a/configure b/configure
index a7e7a825e..ee25f1f24 100755
--- a/configure
+++ b/configure
@@ -642,6 +642,7 @@ CUPS_USER
CUPS_DEFAULT_SHARED
CUPS_BROWSE_LOCAL_PROTOCOLS
CUPS_BROWSING
+CUPS_SYNC_ON_CLOSE
CUPS_PAGE_LOG_FORMAT
CUPS_ACCESS_LOG_LEVEL
CUPS_LOG_LEVEL
@@ -903,6 +904,7 @@ with_fatal_errors
with_log_level
with_access_log_level
enable_page_logging
+enable_sync_on_close
enable_browsing
with_local_protocols
enable_default_shared
@@ -1573,6 +1575,7 @@ Optional Features:
--disable-systemd disable systemd support
--enable-upstart enable upstart support
--enable-page-logging enable page_log by default
+ --enable-sync-on-close enable SyncOnClose (off by default)
--disable-browsing disable Browsing by default
--disable-default-shared
disable DefaultShared by default
@@ -9459,6 +9462,20 @@ else
fi
+# Check whether --enable-sync_on_close was given.
+if test "${enable_sync_on_close+set}" = set; then :
+ enableval=$enable_sync_on_close;
+fi
+
+if test "x$enable_sync_on_close" = xyes; then
+ CUPS_SYNC_ON_CLOSE="Yes"
+ $as_echo "#define CUPS_DEFAULT_SYNC_ON_CLOSE 1" >>confdefs.h
+
+else
+ CUPS_SYNC_ON_CLOSE="No"
+fi
+
+
# Check whether --enable-browsing was given.
if test "${enable_browsing+set}" = set; then :
enableval=$enable_browsing;
diff --git a/man/cups-files.conf.5 b/man/cups-files.conf.5
index b451e2f92..d9b9a63e3 100644
--- a/man/cups-files.conf.5
+++ b/man/cups-files.conf.5
@@ -7,7 +7,7 @@
.\" Licensed under Apache License v2.0. See the file "LICENSE" for more
.\" information.
.\"
-.TH cups-files.conf 5 "CUPS" "26 April 2019" "Apple Inc."
+.TH cups-files.conf 5 "CUPS" "14 November 2020" "Apple Inc."
.SH NAME
cups\-files.conf \- file and directory configuration file for cups
.SH DESCRIPTION
@@ -211,7 +211,6 @@ The default is "/var/run/cups" or "/etc/cups" depending on the platform.
Specifies whether the scheduler calls
.BR fsync (2)
after writing configuration or state files.
-The default is "No".
.\"#SystemGroup
.TP 5
\fBSystemGroup \fIgroup-name \fR[ ... \fIgroup-name\fR ]
diff --git a/scheduler/conf.c b/scheduler/conf.c
index 839cd6866..8dfebe546 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -735,7 +735,11 @@ cupsdReadConfiguration(void)
RootCertDuration = 300;
Sandboxing = CUPSD_SANDBOXING_STRICT;
StrictConformance = FALSE;
+#ifdef CUPS_DEFAULT_SYNC_ON_CLOSE
+ SyncOnClose = TRUE;
+#else
SyncOnClose = FALSE;
+#endif /* CUPS_DEFAULT_SYNC_ON_CLOSE */
Timeout = 900;
WebInterface = CUPS_DEFAULT_WEBIF;
diff --git a/vcnet/config.h b/vcnet/config.h
index 5e105c826..05d36dcfc 100644
--- a/vcnet/config.h
+++ b/vcnet/config.h
@@ -182,6 +182,13 @@ typedef unsigned long useconds_t;
/*
+ * Default SyncOnClose value...
+ */
+
+/* #undef CUPS_DEFAULT_SYNC_ON_CLOSE */
+
+
+/*
* Do we have domain socket support, and if so what is the default one?
*/
diff --git a/xcode/config.h b/xcode/config.h
index 7a3f98aa9..5f8117467 100644
--- a/xcode/config.h
+++ b/xcode/config.h
@@ -103,6 +103,13 @@
/*
+ * Default SyncOnClose value...
+ */
+
+/* #undef CUPS_DEFAULT_SYNC_ON_CLOSE */
+
+
+/*
* Do we have domain socket support, and if so what is the default one?
*/