diff options
author | Jeremy Allison <jra@samba.org> | 1998-11-17 20:50:07 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-11-17 20:50:07 +0000 |
commit | 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac (patch) | |
tree | 4ac25cab78948bd6a334a552d884869443d2d8c2 /source/locking | |
parent | 2a98135bbc759ab334d76cce98ea673871445db1 (diff) | |
download | samba-18ff93a9abbf68ee8c59c0af3e57c63e4a015dac.tar.gz samba-18ff93a9abbf68ee8c59c0af3e57c63e4a015dac.tar.xz samba-18ff93a9abbf68ee8c59c0af3e57c63e4a015dac.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.
Diffstat (limited to 'source/locking')
-rw-r--r-- | source/locking/locking_slow.c | 5 | ||||
-rw-r--r-- | source/locking/shmem.c | 10 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source/locking/locking_slow.c b/source/locking/locking_slow.c index f1e0fa21496..7c273552242 100644 --- a/source/locking/locking_slow.c +++ b/source/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/source/locking/shmem.c b/source/locking/shmem.c index 2a4e4de129a..435c0d4c789 100644 --- a/source/locking/shmem.c +++ b/source/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 |