summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-10-19 08:53:21 +0200
committerVolker Lendecke <vl@samba.org>2010-10-20 13:14:57 +0200
commitda00021a7c236f9ac87442b96881bf0b2701ad0b (patch)
tree302dd9462555c8d78eaea2d0acba0df1df2811a7 /source3/smbd
parent4a8c17a41cd8412247741afbcd8abad77b2a8113 (diff)
downloadsamba-da00021a7c236f9ac87442b96881bf0b2701ad0b.tar.gz
samba-da00021a7c236f9ac87442b96881bf0b2701ad0b.tar.bz2
samba-da00021a7c236f9ac87442b96881bf0b2701ad0b.zip
s3: Cope with EINTR in smbd_[un]lock_socket
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/process.c12
1 files changed, 10 insertions, 2 deletions
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;
}