summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-10-04 22:25:14 +0000
committerimp <imp@FreeBSD.org>2005-10-04 22:25:14 +0000
commit8b90b05d8756a00afff7eb30721d19c5442a80d3 (patch)
tree94de10d6197cb42ffbd0295e855d1cb5f4cf97ca /sys
parent1edcefa858ba0a4d52c23ff6281112e869c9f24b (diff)
downloadFreeBSD-src-8b90b05d8756a00afff7eb30721d19c5442a80d3.zip
FreeBSD-src-8b90b05d8756a00afff7eb30721d19c5442a80d3.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_bus.c8
1 files changed, 6 insertions, 2 deletions
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);
}
OpenPOWER on IntegriCloud