1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

s3: Cope with EINTR in smbd_[un]lock_socket

This commit is contained in:
Volker Lendecke 2010-10-19 08:53:21 +02:00
parent 4a8c17a41c
commit da00021a7c

View File

@ -48,8 +48,12 @@ static bool smbd_lock_socket_internal(struct smbd_server_connection *sconn)
DEBUG(10,("pid[%d] wait for socket lock\n", (int)sys_getpid()));
ok = fcntl_lock(sconn->smb1.echo_handler.socket_lock_fd,
do {
ok = fcntl_lock(
sconn->smb1.echo_handler.socket_lock_fd,
SMB_F_SETLKW, 0, 0, F_WRLCK);
} while (!ok && (errno == EINTR));
if (!ok) {
return false;
}
@ -80,8 +84,12 @@ static bool smbd_unlock_socket_internal(struct smbd_server_connection *sconn)
return true;
}
ok = fcntl_lock(sconn->smb1.echo_handler.socket_lock_fd,
do {
ok = fcntl_lock(
sconn->smb1.echo_handler.socket_lock_fd,
SMB_F_SETLKW, 0, 0, F_UNLCK);
} while (!ok && (errno == EINTR));
if (!ok) {
return false;
}