summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2004-07-20 07:06:43 +0000
committersilby <silby@FreeBSD.org>2004-07-20 07:06:43 +0000
commit9a2c448df915ef4845033ab6e0dd468085c46a7a (patch)
treee67bc51cbe68b06a10fc92c551f50c7ac9d63c11 /sys
parent8b3a02d853f897d3f683a9554fb6ead2f556c9d7 (diff)
downloadFreeBSD-src-9a2c448df915ef4845033ab6e0dd468085c46a7a.zip
FreeBSD-src-9a2c448df915ef4845033ab6e0dd468085c46a7a.tar.gz
Fix a minor error in pipe_stat - st_size was always reported as 0
when direct writes kicked in. Whether this affected any applications is unknown.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_pipe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index aa0445e..fa578e8 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1353,7 +1353,10 @@ pipe_stat(fp, ub, active_cred, td)
bzero(ub, sizeof(*ub));
ub->st_mode = S_IFIFO;
ub->st_blksize = pipe->pipe_buffer.size;
- ub->st_size = pipe->pipe_buffer.cnt;
+ if (pipe->pipe_state & PIPE_DIRECTW)
+ ub->st_size = pipe->pipe_map.cnt;
+ else
+ ub->st_size = pipe->pipe_buffer.cnt;
ub->st_blocks = (ub->st_size + ub->st_blksize - 1) / ub->st_blksize;
ub->st_atimespec = pipe->pipe_atime;
ub->st_mtimespec = pipe->pipe_mtime;
OpenPOWER on IntegriCloud