build: Remove sys_lseek wrapper
authorAndrew Bartlett <abartlet@samba.org>
Wed, 28 Mar 2012 01:37:04 +0000 (12:37 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 5 Apr 2012 00:39:08 +0000 (02:39 +0200)
source3/client/client.c
source3/include/proto.h
source3/lib/dbwrap/dbwrap_file.c
source3/lib/recvfile.c
source3/lib/smbrun.c
source3/lib/system.c
source3/lib/util.c
source3/modules/vfs_default.c
source3/passdb/pdb_smbpasswd.c

index 0d60103f26f9037ee7154e9506c5b5aaa8376314..f10e56348c7396c25c20b1a213edecd31fb8e57e 100644 (file)
@@ -1110,7 +1110,7 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
                if (reget) {
                        handle = sys_open(lname, O_WRONLY|O_CREAT, 0644);
                        if (handle >= 0) {
-                               start = sys_lseek(handle, 0, SEEK_END);
+                               start = lseek(handle, 0, SEEK_END);
                                if (start == -1) {
                                        d_printf("Error seeking local file\n");
                                        return 1;
index 430cfeb8cf27b63f038e73a86859d8c50f8e80f2..b3ab9714e662fab4790a572427faf56d3e35d7e9 100644 (file)
@@ -336,7 +336,6 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
              bool fake_dir_create_times);
 int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
 int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len);
-SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
 SMB_OFF_T sys_ftell(FILE *fp);
 int sys_creat(const char *path, mode_t mode);
 int sys_open(const char *path, int oflag, mode_t mode);
index 8e513b5ad2bc193172eb23a6e19784d7b603c87c..5b0da3a810873cc979417a4828d47383452e94d6 100644 (file)
@@ -199,8 +199,8 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
 
 static NTSTATUS db_file_store_root(int fd, TDB_DATA data)
 {
-       if (sys_lseek(fd, 0, SEEK_SET) != 0) {
-               DEBUG(0, ("sys_lseek failed: %s\n", strerror(errno)));
+       if (lseek(fd, 0, SEEK_SET) != 0) {
+               DEBUG(0, ("lseek failed: %s\n", strerror(errno)));
                return map_nt_error_from_unix(errno);
        }
 
index c74cdd5a67d94a0a028db86ea6df53aa12ca1cbb..6c8a1a3b5779e14b261920a09977240372588e7a 100644 (file)
@@ -63,7 +63,7 @@ static ssize_t default_sys_recvfile(int fromfd,
        }
 
        if (tofd != -1 && offset != (SMB_OFF_T)-1) {
-               if (sys_lseek(tofd, offset, SEEK_SET) == -1) {
+               if (lseek(tofd, offset, SEEK_SET) == -1) {
                        if (errno != ESPIPE) {
                                return -1;
                        }
index b38dee1665bcd4379e84f1eb9f5bdf4bad760321..0ecdc0d68379d6cdd6dda9448eb664d6aa31a6e0 100644 (file)
@@ -132,7 +132,7 @@ static int smbrun_internal(const char *cmd, int *outfd, bool sanitize)
 
                /* Reset the seek pointer. */
                if (outfd) {
-                       sys_lseek(*outfd, 0, SEEK_SET);
+                       lseek(*outfd, 0, SEEK_SET);
                }
 
 #if defined(WIFEXITED) && defined(WEXITSTATUS)
index 1e2c30db2f1abe164d0dcd7d4d83c4caf1d13c05..08d13e6f2bff0682d5b296151c80c831b77d6934 100644 (file)
@@ -584,15 +584,6 @@ int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OF
 #endif
 }
 
-/*******************************************************************
- An lseek() wrapper.
-********************************************************************/
-
-SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence)
-{
-       return lseek(fd, offset, whence);
-}
-
 /*******************************************************************
  An ftell() wrapper.
 ********************************************************************/
index d6e8ed8090c45ea5e60ac4c0011b113b9e3269b2..dcc02b5bafa97b9c7bc7c1288da3d49342520e21 100644 (file)
@@ -347,7 +347,7 @@ ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos
        return (ssize_t)total;
 #else
        /* Use lseek and write_data. */
-       if (sys_lseek(fd, pos, SEEK_SET) == -1) {
+       if (lseek(fd, pos, SEEK_SET) == -1) {
                if (errno != ESPIPE) {
                        return -1;
                }
index f5a64759be4c131ed5399930fccb14bdc2a5ff60..35073143c06a8ab522d3435e51f742613a25a91d 100644 (file)
@@ -634,7 +634,7 @@ static SMB_OFF_T vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB
 
        /* Cope with 'stat' file opens. */
        if (fsp->fh->fd != -1)
-               result = sys_lseek(fsp->fh->fd, offset, whence);
+               result = lseek(fsp->fh->fd, offset, whence);
 
        /*
         * We want to maintain the fiction that we can seek
index 789374a75fe06f7de04db3172eb1d1ed2448e837..4c7ff57f6cc05d0f1e0b38dee35ee6d914e5036e 100644 (file)
@@ -678,9 +678,9 @@ static NTSTATUS add_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state,
         */
        fd = fileno(fp);
 
-       if((offpos = sys_lseek(fd, 0, SEEK_END)) == -1) {
+       if((offpos = lseek(fd, 0, SEEK_END)) == -1) {
                NTSTATUS result = map_nt_error_from_unix(errno);
-               DEBUG(0, ("add_smbfilepwd_entry(sys_lseek): Failed to add entry for user %s to file %s. \
+               DEBUG(0, ("add_smbfilepwd_entry(lseek): Failed to add entry for user %s to file %s. \
 Error was %s\n", newpwd->smb_name, pfile, strerror(errno)));
                endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth);
                return result;
@@ -1039,7 +1039,7 @@ This is no longer supported.!\n", pwd->smb_name));
 
        fd = fileno(fp);
 
-       if (sys_lseek(fd, pwd_seekpos - 1, SEEK_SET) != pwd_seekpos - 1) {
+       if (lseek(fd, pwd_seekpos - 1, SEEK_SET) != pwd_seekpos - 1) {
                DEBUG(0, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile));
                pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth);
                fclose(fp);
@@ -1061,7 +1061,7 @@ This is no longer supported.!\n", pwd->smb_name));
                return False;
        }
  
-       if (sys_lseek(fd, pwd_seekpos, SEEK_SET) != pwd_seekpos) {
+       if (lseek(fd, pwd_seekpos, SEEK_SET) != pwd_seekpos) {
                DEBUG(0, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile));
                pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth);
                fclose(fp);