diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-11-22 08:56:40 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-11-22 08:56:40 +0300 |
commit | 81ca3923a29ea9b67f7291be23b210019546aa5f (patch) | |
tree | fcebf0d426665b4f06e01168f27cd8f9ab8c50d8 /accel-pppd/log.c | |
parent | 830c399cf126f6bf1e8dfa1ad919a3ce8e346c5d (diff) | |
download | accel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.tar.gz accel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.zip |
remove trailing whitespaces
Diffstat (limited to 'accel-pppd/log.c')
-rw-r--r-- | accel-pppd/log.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/accel-pppd/log.c b/accel-pppd/log.c index dcb2b113..0d481ad9 100644 --- a/accel-pppd/log.c +++ b/accel-pppd/log.c @@ -256,7 +256,7 @@ void __export log_free_msg(struct log_msg_t *m) struct _log_msg_t *msg = (struct _log_msg_t *)m->lpd; //printf("free msg %p\n", m); - + mempool_free(m->hdr); _log_free_msg(msg); @@ -270,7 +270,7 @@ static void _log_free_msg(struct _log_msg_t *msg) if (__sync_sub_and_fetch(&msg->refs, 1)) return; - + while(!list_empty(&msg->chunks)) { chunk = list_entry(msg->chunks.next, typeof(*chunk), entry); list_del(&chunk->entry); @@ -287,13 +287,13 @@ static struct log_msg_t *clone_msg(struct _log_msg_t *msg) log_emerg("log: out of memory\n"); return NULL; } - + m->hdr = mempool_alloc(chunk_pool); if (!m->hdr) { log_emerg("log: out of memory\n"); mempool_free(m); return NULL; - } + } m->hdr->len = 0; m->lpd = msg; @@ -311,14 +311,14 @@ static int add_msg(struct _log_msg_t *msg, const char *buf) { struct log_chunk_t *chunk; int i, chunk_cnt, len = strlen(buf); - + if (!list_empty(&msg->chunks)) { chunk = list_entry(msg->chunks.prev, typeof(*chunk), entry); i = min(len, LOG_CHUNK_SIZE - chunk->len); memcpy(chunk->msg + chunk->len, buf, i); chunk->len += i; chunk->msg[chunk->len] = 0; - + if (i == len) return 0; @@ -358,10 +358,10 @@ static void write_msg(FILE *f, struct _log_msg_t *msg, struct ap_session *ses) if (ses) fprintf(f, "%s: %s: ", ses->ifname, ses->sessionid); - + list_for_each_entry(chunk, &msg->chunks, entry) fwrite(chunk->msg, chunk->len, 1, f); - + fflush(f); pthread_mutex_unlock(&lock); } @@ -444,7 +444,7 @@ static void ev_ppp_authorized(struct ap_session *ses) struct _log_msg_t *msg; struct log_msg_t *m; struct log_target_t *t; - + list_for_each_entry(t, &targets, entry) if (t->session_start) t->session_start(ppp); |