aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-09 00:09:58 -0500
committerMike Frysinger <vapier@gentoo.org>2011-11-09 00:09:58 -0500
commit16661d02e961f043b89eddd438b1b5dccca83f12 (patch)
tree305a882e51c32960026b88e2c7835cc80b4614e1
parentf46626dcfc4ea06d4e4171fc8904a379f40b293f (diff)
ssd: fix building when SYS_ioprio_set is missing
Older glibc's might not provide this. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--src/rc/start-stop-daemon.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index b6316ec3..0078c3bd 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -107,12 +107,17 @@ static char *changeuser, *ch_root, *ch_dir;
extern char **environ;
-#ifdef __linux__
+#if !defined(SYS_ioprio_set) && defined(__NR_ioprio_set)
+# define SYS_ioprio_set __NR_ioprio_set
+#endif
static inline int ioprio_set(int which, int who, int ioprio)
{
+#ifdef SYS_ioprio_set
return syscall(SYS_ioprio_set, which, who, ioprio);
-}
+#else
+ return 0;
#endif
+}
static void
free_schedulelist(void)
@@ -1150,13 +1155,10 @@ start_stop_daemon(int argc, char **argv)
strerror(errno));
}
-/* Only linux suports setting an IO priority */
-#ifdef __linux__
if (ionicec != -1 &&
ioprio_set(1, mypid, ionicec | ioniced) == -1)
eerrorx("%s: ioprio_set %d %d: %s", applet,
ionicec, ioniced, strerror(errno));
-#endif
if (ch_root && chroot(ch_root) < 0)
eerrorx("%s: chroot `%s': %s",