tweak syslog error message style

The current error message format uses angle brackets like so:
2013-09-26T11:54:23.931018-07:00 localhost bootcache[3789]: bootcache /mnt/host/source/src/platform/bootcache/bootcache.c:eopen<154> open /sys/devices/virtual/block/dm-0/dm/valid: No such file or directory<2>

For kernel hackers, those angle brackets look wrong.  It implies that
some log message was incorrectly split across lines.  In reality, the
code is trying to just show some numbers.

Even then, it's a little weird.  The format is:
	progname src_file:func<lineno> error message...
But it's much more common (imo) to use the format:
	progname src_file:lineno:func error message...

So tweak the format slightly to avoid these angle brackets.  Now we have:
2013-09-26T12:22:25.853974-07:00 localhost bootcache[3753]: bootcache /mnt/host/source/src/platform/bootcache/bootcache.c:154:eopen open /sys/devices/virtual/block/dm-0/dm/valid: No such file or directory (errno=2)

TEST=booted a system and reviewed /var/log/messages

Change-Id: Iab08241ef2f8804981e662124044424b0279ff04
Reviewed-by: Don Garrett <>
Reviewed-by: Luigi Semenzato <>
Commit-Queue: Mike Frysinger <>
Tested-by: Mike Frysinger <>
diff --git a/bootcache.c b/bootcache.c
index c93eec8..5c6967e 100644
--- a/bootcache.c
+++ b/bootcache.c
@@ -116,7 +116,7 @@
 	int r;
-	r = snprintf(msg, n, "%s %s:%s<%d> ", Progname, file, func, line);
+	r = snprintf(msg, n, "%s %s:%d:%s ", Progname, file, line, func);
 	n -= r;
 	i += r;
 	if (n && fmt) {
@@ -127,7 +127,7 @@
 		if (n && fmt[0] != '\0' && fmt[strlen(fmt)-1] == ':') {
-			snprintf(&msg[i], n, " %s<%d>", strerror(errno), errno);
+			snprintf(&msg[i], n, " %s (errno=%d)", strerror(errno), errno);
 	syslog(LOG_ERR, "%s\n", msg);