Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jul 2005 18:20:31 GMT
From:      soc-tyler <soc-tyler@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 80402 for review
Message-ID:  <200507171820.j6HIKVcB038428@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=80402

Change 80402 by soc-tyler@soc-tyler_launchd on 2005/07/17 18:19:44

	Linkage errors still, release edit locks so I can sync on a RELENG_5 machine. Still working on init(8) and launchd(8) synergy ;)

Affected files ...

.. //depot/projects/soc2005/launchd/Makefile#6 edit
.. //depot/projects/soc2005/launchd/init.c#5 edit
.. //depot/projects/soc2005/launchd/launchd.c#5 edit

Differences ...

==== //depot/projects/soc2005/launchd/Makefile#6 (text+ko) ====

@@ -9,7 +9,9 @@
 	
 MAINTAINER= tyler@tamu.edu
 
-CFLAGS+= -g -Wall -W -Wshadow -Wpadded -Iincludes/
+CFLAGS+= -g -Wall -W -Wshadow -Wpadded -Iincludes -D_LAUNCHD_
+## init.c related CFLAGS
+CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
 LDADD+=	-lutil
 NO_SHARED?=	YES
 

==== //depot/projects/soc2005/launchd/init.c#5 (text+ko) ====

@@ -1,3 +1,8 @@
+/* 
+ * Modifications to this code are my fault (R. Tyler Ballance <tyler@tamu.edu>)
+ * Taken from src/sbin/init/ (init.c rev. 1.60)
+ */
+ 
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -181,6 +186,7 @@
 session_t *find_session(pid_t);
 DB *session_db;
 
+#ifndef _LAUNCHD_
 /*
  * The mother of all processes.
  */
@@ -349,6 +355,7 @@
 	 */
 	return 1;
 }
+#endif
 
 /*
  * Associate a function with a signal handler.

==== //depot/projects/soc2005/launchd/launchd.c#5 (text+ko) ====

@@ -384,7 +384,6 @@
 
 static void pid1_magic_init(bool sflag, bool vflag, bool xflag)
 {
-	pthread_attr_t attr;
 	int memmib[2] = { CTL_HW, HW_PHYSMEM };
 	int mvnmib[2] = { CTL_KERN, KERN_MAXVNODES };
 	int hnmib[2] = { CTL_KERN, KERN_HOSTNAME };
@@ -392,6 +391,7 @@
 	uint32_t mvn;
 	size_t memsz = sizeof(mem);
 #ifdef _BUILD_DARWIN_
+	pthread_attr_t attr;
 	int pthr_r;
 #endif
 
@@ -440,20 +440,19 @@
 	launchd_bootstrap_port = mach_init_init();
 	task_set_bootstrap_port(mach_task_self(), launchd_bootstrap_port);
 	bootstrap_port = MACH_PORT_NULL;
-#endif
 
 	pthread_attr_init(&attr);
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-#ifdef _BUILD_DARWIN_
+	
 	pthr_r = pthread_create(&mach_server_loop_thread, &attr, mach_server_loop, NULL);
 	if (pthr_r != 0) {
 		syslog(LOG_ERR, "pthread_create(mach_server_loop): %s", strerror(pthr_r));
 		exit(EXIT_FAILURE);
 	}
+	
+	pthread_attr_destroy(&attr);
 #endif
 
-	pthread_attr_destroy(&attr);
-
 	init_boot(sflag, vflag, xflag);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507171820.j6HIKVcB038428>