summaryrefslogtreecommitdiffstats
path: root/source/ntvfs/nbench
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-29 01:22:47 +0000
committerAndrew Tridgell <tridge@samba.org>2004-10-29 01:22:47 +0000
commit98daac6a1594ca893588e061e8cd1bfba46a3c0b (patch)
treee2dcaed25b1f39b51c16a3906a21e85ebd5c17fa /source/ntvfs/nbench
parentef2b8a0da3c908d6f54fab41dff0e89bb55cd85f (diff)
downloadsamba-98daac6a1594ca893588e061e8cd1bfba46a3c0b.tar.gz
samba-98daac6a1594ca893588e061e8cd1bfba46a3c0b.tar.xz
samba-98daac6a1594ca893588e061e8cd1bfba46a3c0b.zip
r3349: fixed more uninitialised variable problems with the nbench module
Diffstat (limited to 'source/ntvfs/nbench')
-rw-r--r--source/ntvfs/nbench/vfs_nbench.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/source/ntvfs/nbench/vfs_nbench.c b/source/ntvfs/nbench/vfs_nbench.c
index e542c3fb716..396d3a418ed 100644
--- a/source/ntvfs/nbench/vfs_nbench.c
+++ b/source/ntvfs/nbench/vfs_nbench.c
@@ -286,6 +286,9 @@ static void nbench_open_send(struct smbsrv_request *req)
switch (io->generic.level) {
case RAW_OPEN_NTCREATEX:
+ if (!NT_STATUS_IS_OK(req->async_states->status)) {
+ ZERO_STRUCT(io->ntcreatex.out);
+ }
nbench_log(req, "NTCreateX \"%s\" 0x%x 0x%x %d %s\n",
io->ntcreatex.in.fname,
io->ntcreatex.in.create_options,
@@ -417,20 +420,17 @@ 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;
+ if (!NT_STATUS_IS_OK(req->async_states->status)) {
+ ZERO_STRUCT(rd->readx.out);
}
nbench_log(req, "ReadX %d %d %d %d %s\n",
rd->readx.in.fnum,
(int)rd->readx.in.offset,
rd->readx.in.maxcnt,
- nread,
+ rd->readx.out.nread,
get_nt_error_c_code(req->async_states->status));
break;
default:
@@ -461,6 +461,9 @@ static void nbench_write_send(struct smbsrv_request *req)
switch (wr->generic.level) {
case RAW_WRITE_WRITEX:
+ if (!NT_STATUS_IS_OK(req->async_states->status)) {
+ ZERO_STRUCT(wr->writex.out);
+ }
nbench_log(req, "WriteX %d %d %d %d %s\n",
wr->writex.in.fnum,
(int)wr->writex.in.offset,
@@ -470,6 +473,9 @@ static void nbench_write_send(struct smbsrv_request *req)
break;
case RAW_WRITE_WRITE:
+ if (!NT_STATUS_IS_OK(req->async_states->status)) {
+ ZERO_STRUCT(wr->write.out);
+ }
nbench_log(req, "Write %d %d %d %d %s\n",
wr->write.in.fnum,
wr->write.in.offset,
@@ -756,6 +762,9 @@ static void nbench_search_first_send(struct smbsrv_request *req)
switch (io->generic.level) {
case RAW_SEARCH_BOTH_DIRECTORY_INFO:
+ if (NT_STATUS_IS_ERR(req->async_states->status)) {
+ ZERO_STRUCT(io->t2ffirst.out);
+ }
nbench_log(req, "FIND_FIRST \"%s\" %d %d %d %s\n",
io->t2ffirst.in.pattern,
io->generic.level,