From da00021a7c236f9ac87442b96881bf0b2701ad0b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 19 Oct 2010 08:53:21 +0200 Subject: s3: Cope with EINTR in smbd_[un]lock_socket --- source3/smbd/process.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/smbd/process.c b/source3/smbd/process.c index f2aa23e3e0..99c98e3a37 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -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; } -- cgit