summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plug-nis.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plug-nis.c b/src/plug-nis.c
index 212063a..a3aa8c1 100644
--- a/src/plug-nis.c
+++ b/src/plug-nis.c
@@ -402,7 +402,15 @@ plugin_state_init(Slapi_PBlock *pb, struct plugin_state **lstate)
}
flags = fcntl(sockfd, F_GETFL);
if ((flags & O_NONBLOCK) == 0) {
- fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
+ if (fcntl(sockfd, F_SETFL, flags | O_NONBLOCK) == -1) {
+ slapi_log_error(SLAPI_LOG_FATAL,
+ plugin_description.spd_id,
+ "error marking %s socket as "
+ "non-blocking: %s\n", sock_desc,
+ strerror(errno));
+ close(sockfd);
+ goto failed;
+ }
}
/* If it's a stream socket, let the kernel know that we're
* ready to accept client connections. */
@@ -413,7 +421,6 @@ plugin_state_init(Slapi_PBlock *pb, struct plugin_state **lstate)
"error marking %s socket for "
"listening: %s\n", sock_desc,
strerror(errno));
- flags = fcntl(sockfd, F_GETFL);
close(sockfd);
goto failed;
}