version 1.33, 2006/04/14 02:45:35 |
version 1.34, 2006/04/20 12:13:19 |
|
|
* The <fmt> argument should not have a terminating newline, as this is taken |
* The <fmt> argument should not have a terminating newline, as this is taken |
* care of by the logging facility. |
* care of by the logging facility. |
*/ |
*/ |
int |
void |
cvs_log(u_int level, const char *fmt, ...) |
cvs_log(u_int level, const char *fmt, ...) |
{ |
{ |
int ret; |
|
va_list vap; |
va_list vap; |
|
|
va_start(vap, fmt); |
va_start(vap, fmt); |
ret = cvs_vlog(level, fmt, vap); |
cvs_vlog(level, fmt, vap); |
va_end(vap); |
va_end(vap); |
|
|
return (ret); |
|
} |
} |
|
|
|
|
|
|
* The <fmt> argument should not have a terminating newline, as this is taken |
* The <fmt> argument should not have a terminating newline, as this is taken |
* care of by the logging facility. |
* care of by the logging facility. |
*/ |
*/ |
int |
void |
cvs_vlog(u_int level, const char *fmt, va_list vap) |
cvs_vlog(u_int level, const char *fmt, va_list vap) |
{ |
{ |
int ecp; |
int ecp; |
|
|
#endif |
#endif |
|
|
if (level > LP_MAX) |
if (level > LP_MAX) |
return (-1); |
fatal("cvs_vlog failed"); |
|
|
/* apply any filters */ |
/* apply any filters */ |
if (CVS_LOG_FLTRGET(level)) |
if (CVS_LOG_FLTRGET(level)) |
return (0); |
return; |
|
|
if (level == LP_ERRNO) |
if (level == LP_ERRNO) |
ecp = errno; |
ecp = errno; |
|
|
/* preserve it just in case we changed it? */ |
/* preserve it just in case we changed it? */ |
if (level == LP_ERRNO) |
if (level == LP_ERRNO) |
errno = ecp; |
errno = ecp; |
|
|
return (0); |
|
} |
} |
|
|
|
|