1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

build: Remove sys_lseek wrapper

This commit is contained in:
Andrew Bartlett 2012-03-28 12:37:04 +11:00
parent 5c89d12ca4
commit 43e9be8894
9 changed files with 11 additions and 21 deletions

View 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;

View 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);

View 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);
}

View 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;
}

View 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)

View 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.
********************************************************************/

View 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;
}

View 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

View 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);