From owner-p4-projects@FreeBSD.ORG Thu Aug 18 21:14:23 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 1DCF016A421; Thu, 18 Aug 2005 21:14:23 +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 E6D3316A41F for ; Thu, 18 Aug 2005 21:14:22 +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 8A80B43D48 for ; Thu, 18 Aug 2005 21:14:22 +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 j7ILEMYR072147 for ; Thu, 18 Aug 2005 21:14:22 GMT (envelope-from soc-tyler@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j7ILEMb8072144 for perforce@freebsd.org; Thu, 18 Aug 2005 21:14:22 GMT (envelope-from soc-tyler@freebsd.org) Date: Thu, 18 Aug 2005 21:14:22 GMT Message-Id: <200508182114.j7ILEMb8072144@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 82236 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: Thu, 18 Aug 2005 21:14:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=82236 Change 82236 by soc-tyler@soc-tyler_launchd on 2005/08/18 21:13:43 Take out nonsensical debugging stuff, it was breaking launchctl(1). _lc isn't being calloc()'d somewhere around here, and that's breaking launch_msg() and *everything* (since everything uses it) Affected files ... .. //depot/projects/soc2005/launchd/launchctl/launchctl.c#8 edit .. //depot/projects/soc2005/launchd/liblaunch.c#6 edit Differences ... ==== //depot/projects/soc2005/launchd/launchctl/launchctl.c#8 (text+ko) ==== @@ -1077,10 +1077,6 @@ if (resp == NULL) { fprintf(stderr, "launch_msg(): %s\n", strerror(errno)); return 1; - } else if (resp = 0x1234) { - fprintf(stderr, "launch_msg(): %s\t_lc == NULL: liblaunch.c:690\n", - strerror(errno)); - return 1; } else if (launch_data_get_type(resp) == LAUNCH_DATA_DICTIONARY) { launch_data_dict_iterate(resp, print_jobs, NULL); } else { ==== //depot/projects/soc2005/launchd/liblaunch.c#6 (text+ko) ==== @@ -125,6 +125,7 @@ _lc = calloc(1, sizeof(struct _launch_client)); + // if we can't calloc() _lc, exit function if (_lc == NULL) return; @@ -181,6 +182,8 @@ if (_lc) free(_lc); _lc = NULL; + + fprintf(stderr, "liblaunch.c:launch_client_init():out_bad called\n"); } launch_data_t launch_data_alloc(launch_data_type_t t) { @@ -661,7 +664,7 @@ { pthread_once(&_lc_once, launch_client_init); - if (!_lc) { + if (_lc == NULL) { errno = ENOTCONN; return -1; } @@ -689,7 +692,7 @@ // we error out and say "Socket not connected" here if (_lc == NULL) { errno = ENOTCONN; - return 0x1234; + return NULL; } pthread_mutex_lock(&_lc->mtx);