1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

clvmd,lvmetad: check for fcntl result

Report any problem of fcntl.
This commit is contained in:
Zdenek Kabelac 2012-06-20 10:49:16 +02:00
parent 5d0e7fb4ed
commit c6f680ee49
2 changed files with 4 additions and 2 deletions

View File

@ -2155,7 +2155,8 @@ static int open_local_sock(void)
/* Set Close-on-exec & non-blocking */
if (fcntl(local_socket, F_SETFD, 1))
DEBUGLOG("setting CLOEXEC on local_socket failed: %s\n", strerror(errno));
fcntl(local_socket, F_SETFL, fcntl(local_socket, F_GETFL, 0) | O_NONBLOCK);
if (fcntl(local_socket, F_SETFL, fcntl(local_socket, F_GETFL, 0) | O_NONBLOCK))
DEBUGLOG("setting O_NONBLOCK on local_socket failed: %s\n", strerror(errno));
if (bind(local_socket, (struct sockaddr *) &sockaddr, sizeof(sockaddr))) {

View File

@ -220,7 +220,8 @@ static int _open_socket(daemon_state s)
/* Set Close-on-exec & non-blocking */
if (fcntl(fd, F_SETFD, 1))
fprintf(stderr, "setting CLOEXEC on socket fd %d failed: %s\n", fd, strerror(errno));
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK))
fprintf(stderr, "setting O_NONBLOCK on socket fd %d failed: %s\n", fd, strerror(errno));
fprintf(stderr, "[D] creating %s\n", s.socket_path);
if (!dm_strncpy(sockaddr.sun_path, s.socket_path, sizeof(sockaddr.sun_path))) {