]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Another change for OpenBSD (STR #4526)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Sun, 1 Feb 2015 05:06:54 +0000 (05:06 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Sun, 1 Feb 2015 05:06:54 +0000 (05:06 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12470 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-2.0.txt
scheduler/process.c

index c6f427bd115623d9557d5bc702f6040e12e2aace..e8aa34950891fc441c0b0063456c05772c4d650f 100644 (file)
@@ -37,6 +37,7 @@ CHANGES IN CUPS V2.0.2
        - The ippfind and ipptool programs now correctly match hostnames with
          trailing dots (STR #4563)
        - The ipptool timeout option did not work (STR #4515)
+       - Another change for OpenBSD (STR #4526)
 
 
 CHANGES IN CUPS V2.0.1
index 24ae1140695a2293cb3ed506cddb5ca4d9bfa455..b1fbfff7db090dad5f38912b4dfe20293b85b657 100644 (file)
 #  include <spawn.h>
 extern char **environ;
 #endif /* HAVE_POSIX_SPAWN */
+#ifdef HAVE_POSIX_SPAWN
+#  if !defined(__OpenBSD__) || OpenBSD >= 201505
+#    define USE_POSIX_SPAWN 1
+#  else
+#    define USE_POSIX_SPAWN 0
+#  endif /* !__OpenBSD__ || */
+#else
+#  define USE_POSIX_SPAWN 0
+#endif /* HAVE_POSIX_SPAWN */
 
 
 /*
@@ -468,13 +477,13 @@ cupsdStartProcess(
                nice_str[16];           /* FilterNice string */
   uid_t                user;                   /* Command UID */
   cupsd_proc_t *proc;                  /* New process record */
-#if defined(HAVE_POSIX_SPAWN) && !defined(__OpenBSD__)
+#if USE_POSIX_SPAWN
   posix_spawn_file_actions_t actions;  /* Spawn file actions */
   posix_spawnattr_t attrs;             /* Spawn attributes */
   sigset_t     defsignals;             /* Default signals */
 #elif defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;             /* POSIX signal handler */
-#endif /* HAVE_POSIX_SPAWN && !__OpenBSD__ */
+#endif /* USE_POSIX_SPAWN */
 #if defined(__APPLE__)
   char         processPath[1024],      /* CFProcessPath environment variable */
                linkpath[1024];         /* Link path for symlinks... */
@@ -538,9 +547,9 @@ cupsdStartProcess(
   * Use helper program when we have a sandbox profile...
   */
 
-#if !defined(HAVE_POSIX_SPAWN) || defined(__OpenBSD__)
+#if !USE_POSIX_SPAWN
   if (profile)
-#endif /* !HAVE_POSIX_SPAWN || __OpenBSD__ */
+#endif /* !USE_POSIX_SPAWN */
   {
     snprintf(cups_exec, sizeof(cups_exec), "%s/daemon/cups-exec", ServerBin);
     snprintf(user_str, sizeof(user_str), "%d", user);
@@ -576,7 +585,7 @@ cupsdStartProcess(
       cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdStartProcess: argv[%d] = \"%s\"", i, argv[i]);
   }
 
-#if defined(HAVE_POSIX_SPAWN) && !defined(__OpenBSD__) /* OpenBSD posix_spawn is busted with SETSIGDEF */
+#if USE_POSIX_SPAWN
  /*
   * Setup attributes and file actions for the spawn...
   */
@@ -799,7 +808,7 @@ cupsdStartProcess(
   }
 
   cupsdReleaseSignals();
-#endif /* HAVE_POSIX_SPAWN && !__OpenBSD__ */
+#endif /* USE_POSIX_SPAWN */
 
   if (*pid)
   {