*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <limits.h>
#include <stdio.h>
ret = lttcomm_setsockopt_rcv_timeout(new_fd, timeout);
if (ret) {
- goto error;
+ goto error_close;
}
ret = lttcomm_setsockopt_snd_timeout(new_fd, timeout);
if (ret) {
- goto error;
+ goto error_close;
}
}
end:
return new_sock;
+error_close:
+ if (close(new_fd) < 0) {
+ PERROR("accept inet close fd");
+ }
+
error:
free(new_sock);
return NULL;