Просмотр исходного кода

s-s-d: Call warning instead of fatal on ioprio_set error

This feature should be considered optional, as non-Linux architectures
do not support it, neither do older Linux kernels, and it seems some
virtualization Linux kernels like the OpenVZ patch do not allow it.
Guillem Jover лет назад: 17
Родитель
Сommit
6d36523088
2 измененных файлов с 4 добавлено и 1 удалено
  1. 2 0
      debian/changelog
  2. 2 1
      utils/start-stop-daemon.c

+ 2 - 0
debian/changelog

@@ -9,6 +9,8 @@ dpkg (1.15.5) UNRELEASED; urgency=low
   * Make the upstream build system silent by default with automake 1.11 or
     newer, and always verbose when building the Debian packages.
   * Fix small leak when parsing ‘--ignore-depends’ option values.
+  * When start-stop-daemon fails to set the io scheduling warn instead of
+    finishing fatally.
 
   [ Raphaël Hertzog ]
   * Add versioned dependency on base-files (>= 5.0.0) to dpkg-dev to ensure

+ 2 - 1
utils/start-stop-daemon.c

@@ -616,7 +616,8 @@ set_io_schedule(struct res_schedule *sched)
 
 	io_sched_mask = IOPRIO_PRIO_VALUE(sched->policy, sched->priority);
 	if (ioprio_set(IOPRIO_WHO_PROCESS, getpid(), io_sched_mask) == -1)
-		fatal("Unable to alter IO priority to mask %i", io_sched_mask);
+		warning("Unable to alter IO priority to mask %i (%s)\n",
+		        io_sched_mask, strerror(errno));
 #endif
 }