FILE *dest=stdout;
#define MESSAGE_BUFLEN 1023
static char buff[MESSAGE_BUFLEN+1]={0,};
- uint32_t bp;
+ size_t bp;
char *nlp;
if (secnet_is_daemon) {
/* Messages go to the system log interface */
bp=strlen(buff);
+ assert(bp < MESSAGE_BUFLEN);
vsnprintf(buff+bp,MESSAGE_BUFLEN-bp,message,args);
/* Each line is sent separately */
while ((nlp=strchr(buff,'\n'))) {
*nlp=0;
- slilog(system_log,class,buff);
+ slilog(system_log,class,"%s",buff);
memmove(buff,nlp+1,strlen(nlp+1)+1);
}
} else {
};
static int log_from_fd_beforepoll(void *sst, struct pollfd *fds, int *nfds_io,
- int *timeout_io,
- const struct timeval *tv_now, uint64_t *now)
+ int *timeout_io)
{
struct fdlog *st=sst;
if (!st->finished) {
return 0;
}
-static void log_from_fd_afterpoll(void *sst, struct pollfd *fds, int nfds,
- const struct timeval *tv_now, uint64_t *now)
+static void log_from_fd_afterpoll(void *sst, struct pollfd *fds, int nfds)
{
struct fdlog *st=sst;
int r,remain,i;
prefix);
}
-init_module log_module;
void log_module(dict_t *dict)
{
add_closure(dict,"logfile",logfile_apply);