summaryrefslogtreecommitdiff
path: root/source3/client/client.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-05-20 18:31:36 -0700
committerJeremy Allison <jra@samba.org>2009-05-20 18:31:36 -0700
commit000da55dd930d151db14ee8eed58e82806522692 (patch)
treed04850e454a6f01749ad60d767927e6afaf64fff /source3/client/client.c
parentc1a21d085d758284fe6997a05396f225da683352 (diff)
downloadsamba-000da55dd930d151db14ee8eed58e82806522692.tar.gz
samba-000da55dd930d151db14ee8eed58e82806522692.tar.bz2
samba-000da55dd930d151db14ee8eed58e82806522692.zip
Make cli_posix_open() and cli_posix_mkdir() async.
Jeremy.
Diffstat (limited to 'source3/client/client.c')
-rw-r--r--source3/client/client.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index f4d9963c16..59e5c1ad72 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2296,7 +2296,7 @@ static int cmd_posix_open(void)
char *targetname = NULL;
struct cli_state *targetcli;
mode_t mode;
- int fnum;
+ uint16_t fnum;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("posix_open <filename> 0<mode>\n");
@@ -2321,10 +2321,8 @@ static int cmd_posix_open(void)
return 1;
}
- fnum = cli_posix_open(targetcli, targetname, O_CREAT|O_RDWR, mode);
- if (fnum == -1) {
- fnum = cli_posix_open(targetcli, targetname, O_CREAT|O_RDONLY, mode);
- if (fnum != -1) {
+ if (!NT_STATUS_IS_OK(cli_posix_open(targetcli, targetname, O_CREAT|O_RDWR, mode, &fnum))) {
+ if (!NT_STATUS_IS_OK(cli_posix_open(targetcli, targetname, O_CREAT|O_RDONLY, mode, &fnum))) {
d_printf("posix_open file %s: for read/write fnum %d\n", targetname, fnum);
} else {
d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli));
@@ -2344,7 +2342,6 @@ static int cmd_posix_mkdir(void)
char *targetname = NULL;
struct cli_state *targetcli;
mode_t mode;
- int fnum;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("posix_mkdir <filename> 0<mode>\n");
@@ -2369,8 +2366,7 @@ static int cmd_posix_mkdir(void)
return 1;
}
- fnum = cli_posix_mkdir(targetcli, targetname, mode);
- if (fnum == -1) {
+ if (!NT_STATUS_IS_OK(cli_posix_mkdir(targetcli, targetname, mode))) {
d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli));
} else {
d_printf("posix_mkdir created directory %s\n", targetname);