summaryrefslogtreecommitdiff
path: root/data/system-cmds/reboot.diff
blob: 21d11a3bdb80dfea507288771985e23869d21fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff -r -u system_cmds-431/reboot.tproj/reboot.c system_cmds-431+iPhone/reboot.tproj/reboot.c
--- system_cmds-431/reboot.tproj/reboot.c	2007-09-06 20:46:17.000000000 +0000
+++ system_cmds-431+iPhone/reboot.tproj/reboot.c	2008-02-12 11:29:02.000000000 +0000
@@ -81,11 +81,9 @@
 	int ch, howto, kflag, lflag, nflag, qflag, uflag;
 	char *p;
 	const char *user;
-#ifndef __APPLE__
 	int i, fd, pflag, sverrno;
 	u_int pageins;
 	char *kernel;
-#endif
 
 	if (strstr((p = rindex(*argv, '/')) ? p + 1 : *argv, "halt")) {
 		dohalt = 1;
@@ -240,19 +238,16 @@
 	}
 #endif
 
-#ifdef __APPLE__
-	// launchd(8) handles reboot.  This call returns NULL on success.
-	exit(reboot2(howto) == NULL ? EXIT_SUCCESS : EXIT_FAILURE);
-#else /* __APPLE__ */
 	reboot(howto);
 	/* FALLTHROUGH */
 
+#ifndef __APPLE__
 restart:
+#endif
 	sverrno = errno;
 	errx(1, "%s%s", kill(1, SIGHUP) == -1 ? "(can't restart init): " : "",
 	    strerror(sverrno));
 	/* NOTREACHED */
-#endif /* __APPLE__ */
 }
 
 void