X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=aeeca20e41447d2f3912b3035e739219ff08c62d;hp=d9b3a9defa8164e98be1dda341df3a62b1e4bf9b;hb=818d1a3aa98121ec2d5339d11dece7bc2f5aa6af;hpb=a5927501e41fa3fca2975452617474e78ffecc48 diff --git a/net.c b/net.c index d9b3a9de..aeeca20e 100644 --- a/net.c +++ b/net.c @@ -457,10 +457,11 @@ get_next_src: flowopt_cleanup(fo); if (src == NULL && dst == NULL) { + rc = errno; PARA_ERROR_LOG("can not create %s socket %s#%s.\n", layer4_name(l4type), host? host : (passive? "[loopback]" : "[localhost]"), port); - return -ERRNO_TO_PARA_ERROR(errno); + return -ERRNO_TO_PARA_ERROR(rc); } return sockfd; } @@ -491,8 +492,9 @@ int para_listen(unsigned l4type, uint16_t port, struct flowopts *fo) if (fd > 0) { ret = listen(fd, BACKLOG); if (ret < 0) { + ret = errno; close(fd); - return -ERRNO_TO_PARA_ERROR(errno); + return -ERRNO_TO_PARA_ERROR(ret); } PARA_INFO_LOG("listening on %s port %u, fd %d\n", layer4_name(l4type), port, fd);