From: msweet Date: Sun, 1 Feb 2015 05:06:54 +0000 (+0000) Subject: Another change for OpenBSD (STR #4526) X-Git-Tag: v2.2b1~360 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7616fe837638915768df7c4bb1531a63564236c;p=thirdparty%2Fcups.git Another change for OpenBSD (STR #4526) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12470 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.0.txt b/CHANGES-2.0.txt index c6f427bd11..e8aa349508 100644 --- a/CHANGES-2.0.txt +++ b/CHANGES-2.0.txt @@ -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 diff --git a/scheduler/process.c b/scheduler/process.c index 24ae114069..b1fbfff7db 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -26,6 +26,15 @@ # include 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) {