summaryrefslogtreecommitdiffstats
path: root/lib/log.c
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-04-08 19:51:10 +0100
committerChris Hall <GMCH@hestia.halldom.com>2010-04-08 19:51:10 +0100
commit83447a051fbcc88b33fcea6670520687668d3ba1 (patch)
treef3be10368d9fc6c605c1ec351bc7c1f2c0c61ff0 /lib/log.c
parent17b711e6e4a4d5ce3728a07890434d890ebb76b4 (diff)
downloadquagga-83447a051fbcc88b33fcea6670520687668d3ba1.tar.bz2
quagga-83447a051fbcc88b33fcea6670520687668d3ba1.tar.xz
New functions for error numbers and addresses in messages.
Implemented less onerous ways of including descriptions of errors and IP addresses in logging and other messages. Implemented mapping of error numbers to error names, which is generally more meaningful.
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/log.c b/lib/log.c
index 3e5c80ad..32b11b76 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -289,7 +289,7 @@ uvzlog_line(struct logline* ll, struct zlog *zl, int priority,
va_end(vac);
/* Set pointer to where the '\0' is. */
- p = ll->p_nl = qfs_end(&qfs) ;
+ p = ll->p_nl = qfs_ptr(&qfs) ;
} ;
/* finish off with '\r''\n''\0' or '\n''\0' as required */
@@ -753,9 +753,9 @@ _zlog_abort_err (const char *mess, int err, const char *file,
const static size_t buff_size = 1024;
char buff[buff_size];
snprintf(buff, buff_size,
- "%s, in file %s, line %u, function %s, error %d \"%s\"",
+ "%s, in file %s, line %u, function %s, %s",
mess, file, line, (function ? function : "?"),
- err, safe_strerror(err));
+ errtoa(err, 0).str);
zlog_abort(buff);
}
@@ -939,8 +939,9 @@ zlog_rotate (struct zlog *zl)
{
/* can't call logging while locked */
char *fname = strdup(zl->filename);
- uzlog(NULL, LOG_ERR, "Log rotate failed: cannot open file %s for append: %s",
- fname, safe_strerror(save_errno));
+ uzlog(NULL, LOG_ERR,
+ "Log rotate failed: cannot open file %s for append: %s",
+ fname, errtoa(save_errno, 0).str);
free(fname);
result = -1;
}