From 4639eb5a58f8c0906afdc8e8f8f67f82e9547f75 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 8 Feb 2004 00:51:07 +0000 Subject: Convert libcli routines to use cli_tree instead of cli_state. Port smbtorture to use the new interface. Part 2 will be to eliminate cli_state from smbtorture as this is now the only place where it is used. (This used to be commit db1cc96af62ea42837d60592877fc3f93cef143b) --- source4/torture/raw/seek.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source4/torture/raw/seek.c') diff --git a/source4/torture/raw/seek.c b/source4/torture/raw/seek.c index 85ca9f2869..fa95156969 100644 --- a/source4/torture/raw/seek.c +++ b/source4/torture/raw/seek.c @@ -52,15 +52,15 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) const char *fname = BASEDIR "\\test.txt"; char c[2]; - if (cli_deltree(cli, BASEDIR) == -1 || - !cli_mkdir(cli, BASEDIR)) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli)); + if (cli_deltree(cli->tree, BASEDIR) == -1 || + !cli_mkdir(cli->tree, BASEDIR)) { + printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); return False; } - fnum = cli_open(cli, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE); + fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE); if (fnum == -1) { - printf("Failed to open test.txt - %s\n", cli_errstr(cli)); + printf("Failed to open test.txt - %s\n", cli_errstr(cli->tree)); ret = False; goto done; } @@ -138,8 +138,8 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("trying write to update offset\n"); ZERO_STRUCT(c); - if (cli_write(cli, fnum, 0, c, 0, 2) != 2) { - printf("Write failed - %s\n", cli_errstr(cli)); + if (cli_write(cli->tree, fnum, 0, c, 0, 2) != 2) { + printf("Write failed - %s\n", cli_errstr(cli->tree)); ret = False; goto done; } @@ -158,8 +158,8 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.out.offset, 2); - if (cli_read(cli, fnum, c, 0, 1) != 1) { - printf("Read failed - %s\n", cli_errstr(cli)); + if (cli_read(cli->tree, fnum, c, 0, 1) != 1) { + printf("Read failed - %s\n", cli_errstr(cli->tree)); ret = False; goto done; } @@ -176,9 +176,9 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.out.offset, 1); printf("Testing position information\n"); - fnum2 = cli_open(cli, fname, O_RDWR, DENY_NONE); + fnum2 = cli_open(cli->tree, fname, O_RDWR, DENY_NONE); if (fnum2 == -1) { - printf("2nd open failed - %s\n", cli_errstr(cli)); + printf("2nd open failed - %s\n", cli_errstr(cli->tree)); ret = False; goto done; } @@ -223,7 +223,7 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: smb_raw_exit(cli->session); - cli_deltree(cli, BASEDIR); + cli_deltree(cli->tree, BASEDIR); return ret; } -- cgit