summaryrefslogtreecommitdiffstats
path: root/source/smbd/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/fileio.c')
-rw-r--r--source/smbd/fileio.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/source/smbd/fileio.c b/source/smbd/fileio.c
index d3354b88298..ba60690383b 100644
--- a/source/smbd/fileio.c
+++ b/source/smbd/fileio.c
@@ -37,7 +37,19 @@ SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos)
seek_ret = fsp->conn->vfs_ops.lseek(fsp,fsp->fd,pos+offset,SEEK_SET);
- if(seek_ret == -1) {
+ /*
+ * We want to maintain the fiction that we can seek
+ * on a fifo for file system purposes. This allows
+ * people to set up UNIX fifo's that feed data to Windows
+ * applications. JRA.
+ */
+
+ if((seek_ret == -1) && (errno == ESPIPE)) {
+ seek_ret = pos+offset;
+ errno = 0;
+ }
+
+ if((seek_ret == -1) || (seek_ret != pos+offset)) {
DEBUG(0,("seek_file: sys_lseek failed. Error was %s\n", strerror(errno) ));
fsp->pos = -1;
return -1;
@@ -646,17 +658,3 @@ void sync_file(connection_struct *conn, files_struct *fsp)
conn->vfs_ops.fsync(fsp,fsp->fd);
}
}
-
-
-/************************************************************
- Perform a stat whether a valid fd or not.
-************************************************************/
-
-int fsp_stat(files_struct *fsp, SMB_STRUCT_STAT *pst)
-{
- if (fsp->fd == -1)
- return vfs_stat(fsp->conn, fsp->fsp_name, pst);
- else
- return vfs_fstat(fsp,fsp->fd, pst);
-}
-