diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-03-28 13:32:54 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-04-05 02:39:09 +0200 |
commit | 1ac7f071ce2191599b99eddfb4fb595d2d1f474f (patch) | |
tree | a83cf9e1d4a96849a30d9761b16b60d2ff39177f | |
parent | 6098f8d80cb37fba7d2f245ee1a5c184b0f27aea (diff) | |
download | samba-1ac7f071ce2191599b99eddfb4fb595d2d1f474f.tar.gz samba-1ac7f071ce2191599b99eddfb4fb595d2d1f474f.tar.bz2 samba-1ac7f071ce2191599b99eddfb4fb595d2d1f474f.zip |
build: Remove SMB_F* locking defines
-rw-r--r-- | source3/include/includes.h | 16 | ||||
-rw-r--r-- | source3/lib/pidfile.c | 4 | ||||
-rw-r--r-- | source3/lib/util.c | 2 | ||||
-rw-r--r-- | source3/locking/posix.c | 12 | ||||
-rw-r--r-- | source3/passdb/pdb_smbpasswd.c | 2 | ||||
-rw-r--r-- | source3/smbd/process.c | 4 |
6 files changed, 12 insertions, 28 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 850c0748e9..b0c2a4aabc 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -368,22 +368,6 @@ struct stat_ex { typedef struct stat_ex SMB_STRUCT_STAT; /* - * Defines for 64 bit fcntl locks. - */ - -#ifndef SMB_F_SETLKW -# define SMB_F_SETLKW F_SETLKW -#endif - -#ifndef SMB_F_SETLK -# define SMB_F_SETLK F_SETLK -#endif - -#ifndef SMB_F_GETLK -# define SMB_F_GETLK F_GETLK -#endif - -/* * Type for aiocb structure. */ diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c index f1c89ebaf3..ec2044f327 100644 --- a/source3/lib/pidfile.c +++ b/source3/lib/pidfile.c @@ -92,7 +92,7 @@ pid_t pidfile_pid(const char *program_name) goto noproc; } - if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_RDLCK)) { + if (fcntl_lock(fd,F_SETLK,0,1,F_RDLCK)) { /* we could get the lock - it can't be a Samba process */ goto noproc; } @@ -155,7 +155,7 @@ void pidfile_create(const char *program_name) exit(1); } - if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_WRLCK)==False) { + if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)==False) { DEBUG(0,("ERROR: %s : fcntl lock of file %s failed. Error was %s\n", name, pidFile_name, strerror(errno))); exit(1); diff --git a/source3/lib/util.c b/source3/lib/util.c index c00b45f0b2..22fc1e7abe 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1227,7 +1227,7 @@ bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pi lock.l_len = *pcount; lock.l_pid = 0; - ret = sys_fcntl_ptr(fd,SMB_F_GETLK,&lock); + ret = sys_fcntl_ptr(fd,F_GETLK,&lock); if (ret == -1) { int sav = errno; diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 02402f9774..b219c75fb3 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -1065,7 +1065,7 @@ bool set_posix_lock_windows_flavour(files_struct *fsp, DEBUG(5,("set_posix_lock_windows_flavour: Real lock: Type = %s: offset = %.0f, count = %.0f\n", posix_lock_type_name(posix_lock_type), (double)offset, (double)count )); - if (!posix_fcntl_lock(fsp,SMB_F_SETLK,offset,count,posix_lock_type)) { + if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,posix_lock_type)) { *errno_ret = errno; DEBUG(5,("set_posix_lock_windows_flavour: Lock fail !: Type = %s: offset = %.0f, count = %.0f. Errno = %s\n", posix_lock_type_name(posix_lock_type), (double)offset, (double)count, strerror(errno) )); @@ -1087,7 +1087,7 @@ bool set_posix_lock_windows_flavour(files_struct *fsp, DEBUG(5,("set_posix_lock_windows_flavour: Backing out locks: Type = %s: offset = %.0f, count = %.0f\n", posix_lock_type_name(posix_lock_type), (double)offset, (double)count )); - posix_fcntl_lock(fsp,SMB_F_SETLK,offset,count,F_UNLCK); + posix_fcntl_lock(fsp,F_SETLK,offset,count,F_UNLCK); } } else { /* Remember the number of Windows locks we have on this dev/ino pair. */ @@ -1186,7 +1186,7 @@ bool release_posix_lock_windows_flavour(files_struct *fsp, DEBUG(5,("release_posix_lock_windows_flavour: downgrading lock to READ: offset = %.0f, count = %.0f\n", (double)offset, (double)count )); - if (!posix_fcntl_lock(fsp,SMB_F_SETLK,offset,count,F_RDLCK)) { + if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,F_RDLCK)) { DEBUG(0,("release_posix_lock_windows_flavour: downgrade of lock failed with error %s !\n", strerror(errno) )); talloc_destroy(ul_ctx); return False; @@ -1204,7 +1204,7 @@ bool release_posix_lock_windows_flavour(files_struct *fsp, DEBUG(5,("release_posix_lock_windows_flavour: Real unlock: offset = %.0f, count = %.0f\n", (double)offset, (double)count )); - if (!posix_fcntl_lock(fsp,SMB_F_SETLK,offset,count,F_UNLCK)) { + if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,F_UNLCK)) { ret = False; } } @@ -1251,7 +1251,7 @@ bool set_posix_lock_posix_flavour(files_struct *fsp, return True; } - if (!posix_fcntl_lock(fsp,SMB_F_SETLK,offset,count,posix_lock_type)) { + if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,posix_lock_type)) { *errno_ret = errno; DEBUG(5,("set_posix_lock_posix_flavour: Lock fail !: Type = %s: offset = %.0f, count = %.0f. Errno = %s\n", posix_lock_type_name(posix_lock_type), (double)offset, (double)count, strerror(errno) )); @@ -1341,7 +1341,7 @@ bool release_posix_lock_posix_flavour(files_struct *fsp, DEBUG(5,("release_posix_lock_posix_flavour: Real unlock: offset = %.0f, count = %.0f\n", (double)offset, (double)count )); - if (!posix_fcntl_lock(fsp,SMB_F_SETLK,offset,count,F_UNLCK)) { + if (!posix_fcntl_lock(fsp,F_SETLK,offset,count,F_UNLCK)) { ret = False; } } diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index f5c5b20ebd..9146ed281c 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -102,7 +102,7 @@ static bool do_file_lock(int fd, int waitsecs, int type) alarm(waitsecs); /* Note we must *NOT* use sys_fcntl here ! JRA */ - ret = fcntl(fd, SMB_F_SETLKW, &lock); + ret = fcntl(fd, F_SETLKW, &lock); alarm(0); CatchSignal(SIGALRM, oldsig_handler); diff --git a/source3/smbd/process.c b/source3/smbd/process.c index ae4a1c01c1..7b12315fc3 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -81,7 +81,7 @@ static bool smbd_lock_socket_internal(struct smbd_server_connection *sconn) do { ok = fcntl_lock( sconn->smb1.echo_handler.socket_lock_fd, - SMB_F_SETLKW, 0, 0, F_WRLCK); + F_SETLKW, 0, 0, F_WRLCK); } while (!ok && (errno == EINTR)); if (!ok) { @@ -118,7 +118,7 @@ static bool smbd_unlock_socket_internal(struct smbd_server_connection *sconn) do { ok = fcntl_lock( sconn->smb1.echo_handler.socket_lock_fd, - SMB_F_SETLKW, 0, 0, F_UNLCK); + F_SETLKW, 0, 0, F_UNLCK); } while (!ok && (errno == EINTR)); if (!ok) { |