View | Details | Raw Unified | Return to bug 246845
Collapse All | Expand All

(-)/usr/src/lib/libc/gen/syslog.c (-6 / +19 lines)
Lines 201-215 Link Here
201
	}
201
	}
202
	/*
202
	/*
203
	 * Application name, process ID, message ID and structured data.
203
	 * Application name, process ID, message ID and structured data.
204
	 * Provide the process ID regardless of whether LOG_PID has been
205
	 * specified, as it provides valuable information. Many
206
	 * applications tend not to use this, even though they should.
207
	 */
204
	 */
205
208
	if (LogTag == NULL)
206
	if (LogTag == NULL)
209
		LogTag = _getprogname();
207
		LogTag = _getprogname();
210
	(void)fprintf(fp, "%s %d - - ",
211
	    LogTag == NULL ? "-" : LogTag, getpid());
212
208
209
	(void)fprintf(fp, "%s ", LogTag == NULL ? "-" : LogTag);
210
211
	if (LogStat & LOG_PID)
212
		(void)fprintf(fp, "%d - - ", getpid());
213
	else
214
		(void)fprintf(fp, "- - - ");
215
 
213
	/* Check to see if we can skip expanding the %m */
216
	/* Check to see if we can skip expanding the %m */
214
	if (strstr(fmt, "%m")) {
217
	if (strstr(fmt, "%m")) {
215
218
Lines 437-443 Link Here
437
{
440
{
438
	if (ident != NULL)
441
	if (ident != NULL)
439
		LogTag = ident;
442
		LogTag = ident;
440
	LogStat = logstat;
443
444
	/*
445
	 * Include the process ID by default: it provides valuable
446
	 * information. Many applications tend not to use this, even
447
	 * though they should.
448
	 * Disable LOG_PID only if it is specifically masked.
449
	 */
450
	LogStat = logstat | LOG_PID;
451
	if (logstat != 0 && (logstat &~ LOG_PID) == ~LOG_PID)
452
		LogStat = 0;
453
441
	if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
454
	if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
442
		LogFacility = logfac;
455
		LogFacility = logfac;
443
456
(-)/usr/src/usr.bin/logger/logger.c (-1 / +8 lines)
Lines 171-178 Link Here
171
	if (tag == NULL)
171
	if (tag == NULL)
172
		tag = getlogin();
172
		tag = getlogin();
173
	/* setup for logging */
173
	/* setup for logging */
174
	if (host == NULL)
174
	if (host == NULL) {
175
		/*
176
		 * LOG_PID is default for syslog(3) as of r332100.
177
		 * To disable LOG_PID, set flags to its mask.
178
		 */
179
		if (( logflags & LOG_PID ) != LOG_PID)
180
			logflags = ~logflags;
175
		openlog(tag, logflags, 0);
181
		openlog(tag, logflags, 0);
182
	}
176
	(void) fclose(stdout);
183
	(void) fclose(stdout);
177
184
178
	(void )time(&now);
185
	(void )time(&now);

Return to bug 246845