summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/triton/event.c4
-rw-r--r--accel-pppd/triton/loader.c4
-rw-r--r--accel-pppd/triton/log.c1
-rw-r--r--accel-pppd/triton/md.c6
-rw-r--r--accel-pppd/triton/mempool.c8
-rw-r--r--accel-pppd/triton/timer.c2
-rw-r--r--accel-pppd/triton/triton.c4
7 files changed, 16 insertions, 13 deletions
diff --git a/accel-pppd/triton/event.c b/accel-pppd/triton/event.c
index d45eca01..56472c1c 100644
--- a/accel-pppd/triton/event.c
+++ b/accel-pppd/triton/event.c
@@ -40,7 +40,7 @@ int __export triton_event_register_handler(int ev_id, triton_event_func func)
if (!ev) {
ev = malloc(sizeof(*ev));
if (!ev) {
- triton_log_error("event: out of memory\n");
+ triton_log_error("event: out of memory");
return -1;
}
INIT_LIST_HEAD(&ev->handlers);
@@ -49,7 +49,7 @@ int __export triton_event_register_handler(int ev_id, triton_event_func func)
h = malloc(sizeof(*h));
if (!h) {
- triton_log_error("event: out of memory\n");
+ triton_log_error("event: out of memory");
return -1;
}
diff --git a/accel-pppd/triton/loader.c b/accel-pppd/triton/loader.c
index e2faeb2e..6eb43734 100644
--- a/accel-pppd/triton/loader.c
+++ b/accel-pppd/triton/loader.c
@@ -54,7 +54,7 @@ int load_modules(const char *name)
if (access(fname, F_OK)) {
strcpy(fname, opt->name);
if (access(opt->name, F_OK)) {
- triton_log_error("loader: '%s' not found\n", opt->name);
+ triton_log_error("loader: '%s' not found", opt->name);
continue;
}
}
@@ -62,7 +62,7 @@ int load_modules(const char *name)
h = dlopen(fname, RTLD_LAZY | RTLD_GLOBAL);
if (!h) {
- triton_log_error("loader: failed to load '%s': %s\n", opt->name, dlerror());
+ triton_log_error("loader: failed to load '%s': %s", opt->name, dlerror());
_free(fname);
return -1;
}
diff --git a/accel-pppd/triton/log.c b/accel-pppd/triton/log.c
index c7e6b7fe..95304284 100644
--- a/accel-pppd/triton/log.c
+++ b/accel-pppd/triton/log.c
@@ -45,6 +45,7 @@ static void do_log(FILE *f, const char *fmt, va_list ap)
pthread_mutex_lock(&lock);
fprintf(f, "[%s.%i]", date, (int)tv.tv_usec / 1000);
vfprintf(f, fmt,ap);
+ fprintf(f, "\n");
pthread_mutex_unlock(&lock);
fflush(f);
diff --git a/accel-pppd/triton/md.c b/accel-pppd/triton/md.c
index 84073d05..6c1092d0 100644
--- a/accel-pppd/triton/md.c
+++ b/accel-pppd/triton/md.c
@@ -72,7 +72,7 @@ static void *md_thread(void *arg)
if (n < 0) {
if (errno == EINTR)
continue;
- triton_log_error("md:epoll_wait: %s\n", strerror(errno));
+ triton_log_error("md:epoll_wait: %s", strerror(errno));
_exit(-1);
}
@@ -174,7 +174,7 @@ int __export triton_md_enable_handler(struct triton_md_handler_t *ud, int mode)
r = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, h->ud->fd, &h->epoll_event);
if (r) {
- triton_log_error("md:epoll_ctl: %s\n",strerror(errno));
+ triton_log_error("md:epoll_ctl: %s",strerror(errno));
abort();
}
@@ -201,7 +201,7 @@ int __export triton_md_disable_handler(struct triton_md_handler_t *ud,int mode)
}
if (r) {
- triton_log_error("md:epoll_ctl: %s\n",strerror(errno));
+ triton_log_error("md:epoll_ctl: %s",strerror(errno));
abort();
}
diff --git a/accel-pppd/triton/mempool.c b/accel-pppd/triton/mempool.c
index eb33e427..5323771f 100644
--- a/accel-pppd/triton/mempool.c
+++ b/accel-pppd/triton/mempool.c
@@ -131,7 +131,7 @@ void __export *mempool_alloc(mempool_t *pool)
}
if (!it) {
- triton_log_error("mempool: out of memory\n");
+ triton_log_error("mempool: out of memory");
return NULL;
}
it->owner = p;
@@ -190,7 +190,7 @@ void __export *mempool_alloc_md(mempool_t *pool, const char *fname, int line)
}
if (!it) {
- triton_log_error("mempool: out of memory\n");
+ triton_log_error("mempool: out of memory");
return NULL;
}
it->owner = p;
@@ -282,7 +282,7 @@ static void mempool_clean(void)
struct _item_t *it;
uint32_t size;
- triton_log_error("mempool: clean\n");
+ triton_log_error("mempool: clean");
spin_lock(&pools_lock);
list_for_each_entry(p, &pools, entry) {
@@ -340,7 +340,7 @@ static int mmap_grow(void)
return 0;
oom:
- triton_log_error("mempool: out of memory\n");
+ triton_log_error("mempool: out of memory");
return -1;
}
diff --git a/accel-pppd/triton/timer.c b/accel-pppd/triton/timer.c
index e419e938..fa871b96 100644
--- a/accel-pppd/triton/timer.c
+++ b/accel-pppd/triton/timer.c
@@ -143,7 +143,7 @@ int __export triton_timer_add(struct triton_context_t *ctx, struct triton_timer_
}
if (fcntl(t->fd, F_SETFL, O_NONBLOCK)) {
- triton_log_error("timer: failed to set nonblocking mode: %s\n", strerror(errno));
+ triton_log_error("timer: failed to set nonblocking mode: %s", strerror(errno));
goto out_err;
}
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c
index 9236a003..07405911 100644
--- a/accel-pppd/triton/triton.c
+++ b/accel-pppd/triton/triton.c
@@ -227,8 +227,10 @@ static void ctx_thread(struct _triton_context_t *ctx)
struct _triton_thread_t *create_thread()
{
struct _triton_thread_t *thread = _malloc(sizeof(*thread));
- if (!thread)
+ if (!thread) {
+ triton_log_error("out of memory");
return NULL;
+ }
memset(thread, 0, sizeof(*thread));
pthread_mutex_init(&thread->sleep_lock, NULL);