summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-11-17 20:50:07 +0000
committerJeremy Allison <jra@samba.org>1998-11-17 20:50:07 +0000
commit768761820e8d7481c586c4e0ab4ac7cb36d18c4b (patch)
tree675f36b6854bfccca433842e68e0df4b86cda575 /source3/locking
parentbb5bea4e195eaf5776284c027d667812b7365b56 (diff)
downloadsamba-768761820e8d7481c586c4e0ab4ac7cb36d18c4b.tar.gz
samba-768761820e8d7481c586c4e0ab4ac7cb36d18c4b.tar.bz2
samba-768761820e8d7481c586c4e0ab4ac7cb36d18c4b.zip
Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.
Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking_slow.c5
-rw-r--r--source3/locking/shmem.c10
2 files changed, 7 insertions, 8 deletions
diff --git a/source3/locking/locking_slow.c b/source3/locking/locking_slow.c
index f1e0fa2149..7c27355224 100644
--- a/source3/locking/locking_slow.c
+++ b/source3/locking/locking_slow.c
@@ -165,8 +165,7 @@ static BOOL slow_lock_share_entry(connection_struct *conn,
{
SMB_STRUCT_STAT dummy_stat;
- fd = (int)open(fname,read_only?O_RDONLY:(O_RDWR|O_CREAT),
- SHARE_FILE_MODE);
+ fd = sys_open(fname,read_only?O_RDONLY:(O_RDWR|O_CREAT), SHARE_FILE_MODE);
if(fd < 0)
{
@@ -1008,7 +1007,7 @@ static int slow_share_forall(void (*fn)(share_mode_entry *, char *))
pstrcat(lname,"/");
pstrcat(lname,s);
- fd = open(lname,read_only?O_RDONLY:O_RDWR,0);
+ fd = sys_open(lname,read_only?O_RDONLY:O_RDWR,0);
if (fd < 0) {
continue;
}
diff --git a/source3/locking/shmem.c b/source3/locking/shmem.c
index 2a4e4de129..435c0d4c78 100644
--- a/source3/locking/shmem.c
+++ b/source3/locking/shmem.c
@@ -318,7 +318,7 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth
SMB_OFF_T free_slot = -1;
SMB_OFF_T erased_slot;
- smb_shm_processes_fd = open(processreg_file,
+ smb_shm_processes_fd = sys_open(processreg_file,
read_only?O_RDONLY:(O_RDWR|O_CREAT),
SHM_FILE_MODE);
@@ -429,7 +429,7 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid)
BOOL found = False;
- smb_shm_processes_fd = open(processreg_file, O_RDWR);
+ smb_shm_processes_fd = sys_open(processreg_file, O_RDWR, 0);
if ( smb_shm_processes_fd < 0 )
{
DEBUG(0,("ERROR smb_shm_unregister_process : processreg_file open failed with code %s\n",strerror(errno)));
@@ -818,7 +818,7 @@ struct shmem_ops *smb_shm_open(int ronly)
DEBUG(5,("smb_shm_open : using shmem file %s to be of size %.0f\n",
file_name,(double)size));
- smb_shm_fd = open(file_name, read_only?O_RDONLY:(O_RDWR|O_CREAT),
+ smb_shm_fd = sys_open(file_name, read_only?O_RDONLY:(O_RDWR|O_CREAT),
SHM_FILE_MODE);
if ( smb_shm_fd < 0 )
@@ -917,9 +917,9 @@ size (%.0f), using filesize\n", (double)filesize, (double)size));
size = filesize;
}
- smb_shm_header_p = (struct SmbShmHeader *)mmap(NULL, size,
+ smb_shm_header_p = (struct SmbShmHeader *)sys_mmap(NULL, size,
read_only?PROT_READ: (PROT_READ | PROT_WRITE),
- MAP_FILE | MAP_SHARED, smb_shm_fd, 0);
+ MAP_FILE | MAP_SHARED, smb_shm_fd, (SMB_OFF_T)0);
/*
* WARNING, smb_shm_header_p can be different for different