summaryrefslogtreecommitdiff
path: root/source4/ntvfs/nbench
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-29 01:07:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:58 -0500
commit10ae6167651bc4fe3169c6c4086eef4920b0d739 (patch)
treec7f68119ce8b392988c698e358de808e6ff897aa /source4/ntvfs/nbench
parent6876fae4ebba0caea1e5e3274b9856b056e54079 (diff)
downloadsamba-10ae6167651bc4fe3169c6c4086eef4920b0d739.tar.gz
samba-10ae6167651bc4fe3169c6c4086eef4920b0d739.tar.bz2
samba-10ae6167651bc4fe3169c6c4086eef4920b0d739.zip
r3347: fixed an uninitialised variable bug. Surprisingly hard to track down,
as valgrind got a corrupt stack when trying to debug it. (This used to be commit 58cabaa7022e5521961551462d31fbd90e4183e4)
Diffstat (limited to 'source4/ntvfs/nbench')
-rw-r--r--source4/ntvfs/nbench/vfs_nbench.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/ntvfs/nbench/vfs_nbench.c b/source4/ntvfs/nbench/vfs_nbench.c
index f9a93aa1c7..e542c3fb71 100644
--- a/source4/ntvfs/nbench/vfs_nbench.c
+++ b/source4/ntvfs/nbench/vfs_nbench.c
@@ -417,14 +417,20 @@ static NTSTATUS nbench_copy(struct ntvfs_module_context *ntvfs,
static void nbench_read_send(struct smbsrv_request *req)
{
union smb_read *rd = req->async_states->private_data;
-
+ uint32_t nread;
+
switch (rd->generic.level) {
case RAW_READ_READX:
+ if (NT_STATUS_IS_OK(req->async_states->status)) {
+ nread = rd->readx.out.nread;
+ } else {
+ nread = 0;
+ }
nbench_log(req, "ReadX %d %d %d %d %s\n",
rd->readx.in.fnum,
(int)rd->readx.in.offset,
rd->readx.in.maxcnt,
- rd->readx.out.nread,
+ nread,
get_nt_error_c_code(req->async_states->status));
break;
default: