Date: Thu, 18 Aug 2005 21:14:22 GMT From: soc-tyler <soc-tyler@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 82236 for review Message-ID: <200508182114.j7ILEMb8072144@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508182114.j7ILEMb8072144>