From cf3a9741dc7427efb97eff09a3c197a906ce6767 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Sep 1998 21:43:48 +0000 Subject: Changes to test in configure if capabilities are enabled on a system. Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09) --- source3/locking/locking_shm.c | 6 ------ source3/locking/shmem.c | 8 ++++++-- source3/locking/shmem_sysv.c | 5 ----- 3 files changed, 6 insertions(+), 13 deletions(-) (limited to 'source3/locking') diff --git a/source3/locking/locking_shm.c b/source3/locking/locking_shm.c index 2e7d29f745..1077cf23eb 100644 --- a/source3/locking/locking_shm.c +++ b/source3/locking/locking_shm.c @@ -398,7 +398,6 @@ static BOOL shm_set_share_mode(int token, files_struct *fsp, uint16 port, uint16 int *mode_array; unsigned int hash_entry; share_mode_record *file_scanner_p; - share_mode_record *file_prev_p; shm_share_mode_entry *new_entry_p; int new_entry_offset; BOOL found = False; @@ -411,7 +410,6 @@ static BOOL shm_set_share_mode(int token, files_struct *fsp, uint16 port, uint16 mode_array = (int *)shmops->offset2addr(shmops->get_userdef_off()); file_scanner_p = (share_mode_record *)shmops->offset2addr(mode_array[hash_entry]); - file_prev_p = file_scanner_p; while(file_scanner_p) { @@ -422,7 +420,6 @@ static BOOL shm_set_share_mode(int token, files_struct *fsp, uint16 port, uint16 } else { - file_prev_p = file_scanner_p ; file_scanner_p = (share_mode_record *) shmops->offset2addr(file_scanner_p->next_offset); } @@ -509,7 +506,6 @@ static BOOL shm_remove_share_oplock(files_struct *fsp, int token) share_mode_record *file_scanner_p; share_mode_record *file_prev_p; shm_share_mode_entry *entry_scanner_p; - shm_share_mode_entry *entry_prev_p; BOOL found = False; int pid = getpid(); @@ -568,7 +564,6 @@ static BOOL shm_remove_share_oplock(files_struct *fsp, int token) found = False; entry_scanner_p = (shm_share_mode_entry*)shmops->offset2addr( file_scanner_p->share_mode_entries); - entry_prev_p = entry_scanner_p; while(entry_scanner_p) { if( (pid == entry_scanner_p->e.pid) && @@ -584,7 +579,6 @@ static BOOL shm_remove_share_oplock(files_struct *fsp, int token) } else { - entry_prev_p = entry_scanner_p; entry_scanner_p = (shm_share_mode_entry *) shmops->offset2addr(entry_scanner_p->next_share_mode_entry); } diff --git a/source3/locking/shmem.c b/source3/locking/shmem.c index f1c985881b..b63db1f168 100644 --- a/source3/locking/shmem.c +++ b/source3/locking/shmem.c @@ -384,7 +384,6 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid) int nb_read; pid_t other_pid; SMB_OFF_T seek_back = -((SMB_OFF_T)sizeof(other_pid)); - SMB_OFF_T erased_slot; BOOL found = False; @@ -404,7 +403,12 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid) DEBUG(5,("smb_shm_unregister_process : erasing record for pid %d (seek_val = %.0f)\n", (int)other_pid, (double)seek_back)); other_pid = (pid_t)0; - erased_slot = sys_lseek(smb_shm_processes_fd, seek_back, SEEK_CUR); + if(sys_lseek(smb_shm_processes_fd, seek_back, SEEK_CUR) == -1) + { + DEBUG(0,("ERROR smb_shm_unregister_process : processreg_file sys_lseek failed with code %s\n",strerror(errno))); + close(smb_shm_processes_fd); + return False; + } if(write(smb_shm_processes_fd, &other_pid, sizeof(other_pid)) < 0) { DEBUG(0,("ERROR smb_shm_unregister_process : processreg_file write failed with code %s\n",strerror(errno))); diff --git a/source3/locking/shmem_sysv.c b/source3/locking/shmem_sysv.c index b57116f7b8..1dd4743df0 100644 --- a/source3/locking/shmem_sysv.c +++ b/source3/locking/shmem_sysv.c @@ -92,7 +92,6 @@ struct ShmBlockDesc #define AlignedHeaderSize ((sizeof(struct ShmHeader)+7) & ~7) static struct ShmHeader *shm_header_p = NULL; -static BOOL shm_initialize_called = False; static int read_only; @@ -447,8 +446,6 @@ static BOOL shm_initialize(int size) shm_header_p->consistent = True; - shm_initialize_called = True; - return True; } @@ -533,7 +530,6 @@ static struct shmem_ops shmops = { ******************************************************************/ struct shmem_ops *sysv_shm_open(int ronly) { - BOOL created_new = False; BOOL other_processes; struct shmid_ds shm_ds; struct semid_ds sem_ds; @@ -661,7 +657,6 @@ struct shmem_ops *sysv_shm_open(int ronly) (errno != EINVAL && errno != ENOSPC)) break; shm_size *= 0.8; } - created_new = (shm_id != -1); } if (shm_id == -1) { -- cgit