summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-04-19 03:05:38 +0000
committerJeremy Allison <jra@samba.org>2002-04-19 03:05:38 +0000
commitb63be4e1abf419f68755c6b4def8d960c32e70cb (patch)
tree826d26feb65ef00455b8ba269a8d562f75fc1459 /source3/lib/util.c
parentfc78c773f8216df1bbaa88d9007cf3f5df386e3d (diff)
downloadsamba-b63be4e1abf419f68755c6b4def8d960c32e70cb.tar.gz
samba-b63be4e1abf419f68755c6b4def8d960c32e70cb.tar.bz2
samba-b63be4e1abf419f68755c6b4def8d960c32e70cb.zip
Added sys_fcntl (not to be used everywhere). Added sys_read/sys_write
for transfer_file. Jeremy. (This used to be commit c7ff521bab838c070931f2b0ece4be3371fbcdbf)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index c524adaa7a..1ee1a9c06a 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -552,13 +552,13 @@ int set_blocking(int fd, BOOL set)
#endif
#endif
- if((val = fcntl(fd, F_GETFL, 0)) == -1)
+ if((val = sys_fcntl(fd, F_GETFL, 0)) == -1)
return -1;
if(set) /* Turn blocking on - ie. clear nonblock flag */
val &= ~FLAG_TO_SET;
else
val |= FLAG_TO_SET;
- return fcntl( fd, F_SETFL, val);
+ return sys_fcntl( fd, F_SETFL, val);
#undef FLAG_TO_SET
}
@@ -620,7 +620,7 @@ ssize_t transfer_file_internal(int infd, int outfd, size_t n, ssize_t (*read_fn)
SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n)
{
- return (SMB_OFF_T)transfer_file_internal(infd, outfd, (size_t)n, read, write);
+ return (SMB_OFF_T)transfer_file_internal(infd, outfd, (size_t)n, sys_read, sys_write);
}
/*******************************************************************
@@ -1353,10 +1353,7 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
lock.l_len = count;
lock.l_pid = 0;
- do {
- errno = 0;
- ret = fcntl(fd,op,&lock);
- } while (ret == -1 && errno == EINTR);
+ ret = sys_fcntl(fd,op,&lock);
if (ret == -1 && errno != 0)
DEBUG(3,("fcntl_lock: fcntl lock gave errno %d (%s)\n",errno,strerror(errno)));