From 8b90b05d8756a00afff7eb30721d19c5442a80d3 Mon Sep 17 00:00:00 2001 From: imp Date: Tue, 4 Oct 2005 22:25:14 +0000 Subject: When data passed into devctl_notify is NULL, don't print (null). Instead don't print anything at all. # this fixes a problem that I noticed with devd.pipe not terminating lines # with \n correctly sometimes. --- sys/kern/subr_bus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index b475257..a0a7c1e 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -553,8 +553,12 @@ devctl_notify(const char *system, const char *subsystem, const char *type, msg = malloc(len, M_BUS, M_NOWAIT); if (msg == NULL) return; /* Drop it on the floor */ - snprintf(msg, len, "!system=%s subsystem=%s type=%s %s\n", system, - subsystem, type, data); + if (data != NULL) + snprintf(msg, len, "!system=%s subsystem=%s type=%s %s\n", + system, subsystem, type, data); + else + snprintf(msg, len, "!system=%s subsystem=%s type=%s\n", + system, subsystem, type); devctl_queue_data(msg); } -- cgit v1.1