]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add --enable-sync-on-close configure option (Issue #37)
authorMichael R Sweet <msweet@msweet.org>
Sat, 14 Nov 2020 14:58:12 +0000 (09:58 -0500)
committerMichael R Sweet <msweet@msweet.org>
Sat, 14 Nov 2020 14:58:12 +0000 (09:58 -0500)
CHANGES-OPENPRINTING.md
conf/cups-files.conf.in
config-scripts/cups-defaults.m4
config.h.in
configure
man/cups-files.conf.5
scheduler/conf.c
vcnet/config.h
xcode/config.h

index f2f449961bfe72aaf6db3eca9d3450b9ccdf11a2..8a7c799727d6fd563c72a820b1c559cdb5a9d18f 100644 (file)
@@ -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.
index 4a78ba6158fa593fe88ca6a34cf11153f9d35aad..af11fcce67c65d2c7e859693ade77784d3f9f092 100644 (file)
@@ -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...
index b6051778dbd155ce1f561b6647fe5c883404ffda..df386b822d8b45951055f2e4320d36c50349ff8e 100644 (file)
@@ -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
index 6a197ecc56eabda2a422317e7a9e352dbca7f1fe..6343e6dd040831400dff41c9cf0e0b4511084238 100644 (file)
 #define CUPS_DEFAULT_MAX_COPIES        9999
 
 
+/*
+ * Default SyncOnClose value...
+ */
+
+#undef CUPS_DEFAULT_SYNC_ON_CLOSE
+
+
 /*
  * Do we have domain socket support, and if so what is the default one?
  */
index a7e7a825eb6251c10b1e79b75f9ee7c63e5183d7..ee25f1f246a7614fddfb34e58d46c1f3c15d2b98 100755 (executable)
--- 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;
index b451e2f921b385c4f4c6ea8c79e91e78c7418869..d9b9a63e3c26425077254365df29e64b2df775b2 100644 (file)
@@ -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 ]
index 839cd68661cd37248336169875198990c2a46b33..8dfebe546777aa77a495087e8e47fd54d1f30b8e 100644 (file)
@@ -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;
 
index 5e105c826592f775829970fac9a52faea339a115..05d36dcfcc949bb01172fb4813f08f1482a7de7b 100644 (file)
@@ -181,6 +181,13 @@ typedef unsigned long useconds_t;
 #define CUPS_DEFAULT_MAX_COPIES 9999
 
 
+/*
+ * Default SyncOnClose value...
+ */
+
+/* #undef CUPS_DEFAULT_SYNC_ON_CLOSE */
+
+
 /*
  * Do we have domain socket support, and if so what is the default one?
  */
index 7a3f98aa9da1b9d0b531f71331e3117cc6de2692..5f8117467107c2397a304c1652f3cf27f8379ebb 100644 (file)
 #define CUPS_DEFAULT_MAX_COPIES 9999
 
 
+/*
+ * Default SyncOnClose value...
+ */
+
+/* #undef CUPS_DEFAULT_SYNC_ON_CLOSE */
+
+
 /*
  * Do we have domain socket support, and if so what is the default one?
  */