[dpkg] 93/187: s-s-d: Handle _POSIX_PRIORITY_SCHEDULING being defined to -1 or 0
Reiner Herrmann
reiner at reiner-h.de
Sun Nov 6 12:46:28 UTC 2016
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch master
in repository dpkg.
commit 37af4e517e8fdf925638ddc57138a89ff0b8e8dd
Author: Guillem Jover <guillem at debian.org>
Date: Tue Aug 23 21:39:24 2016 +0200
s-s-d: Handle _POSIX_PRIORITY_SCHEDULING being defined to -1 or 0
POSIX states that these can be defined as -1 (unavailable), or 0
(available at build-time, but might or might not be available at
run-time). Handles these, which happens to be the case in Mac OS X.
---
debian/changelog | 2 ++
utils/start-stop-daemon.c | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 1c380a4..477ec51 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -36,6 +36,8 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
- Cast strlen() return value to ssize_t to match write() return type.
- Use underscore-prefixed system preprocessor symbols instead of namespace
polluting ones (such as “linux”, “OPENBSD” or “hpux”).
+ - Handle _POSIX_PRIORITY_SCHEDULING being defined to -1 or 0 in
+ start-stop-daemon. This affects Mac OS X.
* Perl modules:
- Obsolete Source-Version substvar in Dpkg::Substvars by emitting errors.
- Rework keyring hooks in Dpkg::Vendor. Deprecate the keyrings hook, and
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 7152d10..4245e45 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -112,7 +112,7 @@
#endif
#endif
-#ifdef _POSIX_PRIORITY_SCHEDULING
+#if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
#include <sched.h>
#else
#define SCHED_OTHER -1
@@ -731,7 +731,7 @@ parse_umask(const char *string, int *value_r)
static void
validate_proc_schedule(void)
{
-#ifdef _POSIX_PRIORITY_SCHEDULING
+#if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
int prio_min, prio_max;
prio_min = sched_get_priority_min(proc_sched->policy);
@@ -814,7 +814,7 @@ parse_io_schedule(const char *string)
static void
set_proc_schedule(struct res_schedule *sched)
{
-#ifdef _POSIX_PRIORITY_SCHEDULING
+#if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
struct sched_param param;
param.sched_priority = sched->priority;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list