Репозитории ALT
5.1: | 2.86-alt2 |
4.1: | 2.86-alt2 |
4.0: | 2.86-alt1 |
3.0: | 2.85-alt8 |
Группа :: Система/Настройка/Загрузка и инициализация
Пакет: SysVinit
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: sysvinit-2.86-deb-bootlogd-exitcode.patch
Скачать
Скачать
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50_bootlogd_exitcode.dpatch by Petter Reinholdtsen
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Make sure bootlogd return non-error exit code when forking off the
## DP: child. Fixes bug #326640.
@DPATCH@
Index: sysvinit/src/bootlogd.c
===================================================================
--- sysvinit/src/bootlogd.c (revisjon 56)
+++ sysvinit/src/bootlogd.c (arbeidskopi)
@@ -523,8 +523,19 @@
* Fork and write pidfile if needed.
*/
if (!dontfork) {
- if (fork())
+ pid_t child_pid = fork();
+ switch (child_pid) {
+ case -1: /* I am parent and the attempt to create a child failed */
+ fprintf(stderr, "bootlogd: fork failed: %s\n",
+ strerror(errno));
exit(1);
+ break;
+ case 0: /* I am the child */
+ break;
+ default: /* I am parent and got child's pid */
+ exit(0);
+ break;
+ }
setsid();
}
if (pidfile) {