From owner-p4-projects@FreeBSD.ORG Sun Jul 17 18:20:32 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 29A3816A420; Sun, 17 Jul 2005 18:20:32 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F189716A41C for ; Sun, 17 Jul 2005 18:20:31 +0000 (GMT) (envelope-from soc-tyler@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAB8543D46 for ; Sun, 17 Jul 2005 18:20:31 +0000 (GMT) (envelope-from soc-tyler@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6HIKVmD038431 for ; Sun, 17 Jul 2005 18:20:31 GMT (envelope-from soc-tyler@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6HIKVcB038428 for perforce@freebsd.org; Sun, 17 Jul 2005 18:20:31 GMT (envelope-from soc-tyler@freebsd.org) Date: Sun, 17 Jul 2005 18:20:31 GMT Message-Id: <200507171820.j6HIKVcB038428@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-tyler@freebsd.org using -f From: soc-tyler To: Perforce Change Reviews Cc: Subject: PERFORCE change 80402 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2005 18:20:33 -0000 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 ) + * 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); }