From 3293eaa34b6574de5f6f283523793c5d958a9138 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Tue, 11 Oct 2016 21:18:57 +0800 Subject: [PATCH] don't send non-error message to stderr Signed-off-by: Lai Jiangshan --- src/event.c | 2 +- src/net.c | 3 +++ src/util.c | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/event.c b/src/event.c index ea38ef0..abcd30f 100644 --- a/src/event.c +++ b/src/event.c @@ -179,7 +179,7 @@ int hyper_handle_event(int efd, struct epoll_event *event) } if (event->events & EPOLLERR) { - fprintf(stderr, "get epoll err of not epool in event\n"); + fprintf(stdout, "get epoll err on event: %p\n", he); if (he->ops->hup) he->ops->hup(he, efd); return 0; diff --git a/src/net.c b/src/net.c index d255fb7..bcbe133 100644 --- a/src/net.c +++ b/src/net.c @@ -915,6 +915,9 @@ void hyper_cleanup_dns(struct hyper_pod *pod) { int fd, i; + if (pod->dns == NULL) + return; + for (i = 0; i < pod->d_num; i++) { free(pod->dns[i]); } diff --git a/src/util.c b/src/util.c index 8f7ab24..d2af2b8 100644 --- a/src/util.c +++ b/src/util.c @@ -538,7 +538,6 @@ int hyper_open_channel(char *channel, int mode) fd = -1; if (strncmp(name, channel, strlen(channel))) { - fprintf(stderr, "channel %s, directory %s\n", channel, name); continue; }