This fixes a bug in the use of errno which corresponds to the 'common mistake'
in the use of errno(3): to not save it before making new system calls. Thanks.
flowopt_cleanup(fo);
if (src == NULL && dst == NULL) {
flowopt_cleanup(fo);
if (src == NULL && dst == NULL) {
PARA_ERROR_LOG("can not create %s socket %s#%s.\n",
layer4_name(l4type), host? host : (passive?
"[loopback]" : "[localhost]"), port);
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);
if (fd > 0) {
ret = listen(fd, BACKLOG);
if (ret < 0) {
if (fd > 0) {
ret = listen(fd, BACKLOG);
if (ret < 0) {
- 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);
}
PARA_INFO_LOG("listening on %s port %u, fd %d\n",
layer4_name(l4type), port, fd);