Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37892018
en ru br
Репозитории ALT
5.1: 2.86-alt2
4.1: 2.86-alt2
4.0: 2.86-alt1
3.0: 2.85-alt8
www.altlinux.org/Changes

Группа :: Система/Настройка/Загрузка и инициализация
Пакет: 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) {
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin