subr_prf: Don't write kern.boot_tag if it's empty

This change allows one to set kern.boot_tag="" and not get a blank line
preceding other boot messages. While this isn't super critical- blank lines
are easy to filter out both mentally and in processing dmesg later- it
allows for a mode of operation that matches previous behavior.

I intend to MFC this whole series to stable/11 by the end of the month with
boot_tag empty by default to make this effectively a nop in the stable
branch.
This commit is contained in:
Kyle Evans 2018-08-17 03:42:57 +00:00
parent b509cad4fe
commit 45625675e7

View File

@ -1048,7 +1048,7 @@ msgbufinit(void *ptr, int size)
if (msgbufmapped && oldp != msgbufp)
msgbuf_copy(oldp, msgbufp);
msgbufmapped = true;
if (print_boot_tag)
if (print_boot_tag && *current_boot_tag != '\0')
printf("%s\n", current_boot_tag);
oldp = msgbufp;
}