aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/interface.c6
-rw-r--r--src/log.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/interface.c b/src/interface.c
index 7dbcd2dc3..9a79f102e 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -604,7 +604,7 @@ static void closeAllInterfaces(void)
int i;
for (i = 0; i < interface_max_connections; i++) {
- if (interfaces[i].fd > 0)
+ if (interfaces[i].fd >= 0)
closeInterface(&(interfaces[i]));
if (interfaces[i].send_buf)
free(interfaces[i].send_buf);
@@ -626,7 +626,7 @@ void closeOldInterfaces(void)
int i;
for (i = 0; i < interface_max_connections; i++) {
- if (interfaces[i].fd > 0) {
+ if (interfaces[i].fd >= 0) {
if (interfaces[i].expired) {
DEBUG("interface %i: expired\n", i);
closeInterface(&(interfaces[i]));
@@ -690,7 +690,7 @@ int interfacePrintWithFD(int fd, char *buffer, int buflen)
int copylen;
Interface *interface;
- assert(fd > 0);
+ assert(fd >= 0);
if (i >= interface_max_connections ||
interfaces[i].fd < 0 || interfaces[i].fd != fd) {
diff --git a/src/log.c b/src/log.c
index 0d2d0b0b2..eb1d5a94d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -36,8 +36,8 @@ static const char *err_filename;
static void redirect_logs(void)
{
- assert(out_fd > 0);
- assert(err_fd > 0);
+ assert(out_fd >= 0);
+ assert(err_fd >= 0);
if (dup2(out_fd, STDOUT_FILENO) < 0)
FATAL("problems dup2 stdout : %s\n", strerror(errno));
if (dup2(err_fd, STDERR_FILENO) < 0)
@@ -241,8 +241,8 @@ void close_log_files(void)
{
if (stdout_mode)
return;
- assert(out_fd > 0);
- assert(err_fd > 0);
+ assert(out_fd >= 0);
+ assert(err_fd >= 0);
xclose(out_fd);
xclose(err_fd);
}