summaryrefslogtreecommitdiff
path: root/data/system-cmds/reboot.diff
blob: 4c9dc152d5faeb8a38ed5fb9767e443350fceb53 (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
38
39
40
41
42
43
44
45
diff -ru 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-03-30 20:43:53.000000000 +0000
@@ -63,7 +63,6 @@
 #include <mach/mach_port.h>		// allocate
 #include <mach/mach.h>			// task_self, etc
 #include <servers/bootstrap.h>	// bootstrap
-#include <reboot2.h>
 #endif
 
 void usage(void);
@@ -81,11 +80,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 +237,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