summaryrefslogtreecommitdiff
path: root/source3/utils/smbcquotas.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-11-14 14:11:24 +0100
committerVolker Lendecke <vl@samba.org>2010-11-14 14:18:46 +0100
commita2769b069b11c92f4b4822f4eb3e66b8aadd18ca (patch)
treecf5b75d75ca1868c6d94bcbba8eab89ba25d7acb /source3/utils/smbcquotas.c
parent36637a7ced4ac9f0a0846ba75b56ccdf2599ffea (diff)
downloadsamba-a2769b069b11c92f4b4822f4eb3e66b8aadd18ca.tar.gz
samba-a2769b069b11c92f4b4822f4eb3e66b8aadd18ca.tar.bz2
samba-a2769b069b11c92f4b4822f4eb3e66b8aadd18ca.zip
s3: Avoid two calls cli_errstr
Diffstat (limited to 'source3/utils/smbcquotas.c')
-rw-r--r--source3/utils/smbcquotas.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index 980ba2b5c1..6353272d82 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -238,11 +238,14 @@ static int do_quota(struct cli_state *cli,
uint16_t quota_fnum = 0;
SMB_NTQUOTA_LIST *qtl = NULL;
SMB_NTQUOTA_STRUCT qt;
+ NTSTATUS status;
+
ZERO_STRUCT(qt);
- if (!NT_STATUS_IS_OK(cli_get_fs_attr_info(cli, &fs_attrs))) {
+ status = cli_get_fs_attr_info(cli, &fs_attrs);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Failed to get the filesystem attributes %s.\n",
- cli_errstr(cli));
+ nt_errstr(status));
return -1;
}
@@ -251,10 +254,12 @@ static int do_quota(struct cli_state *cli,
return 0;
}
- if (!NT_STATUS_IS_OK(cli_get_quota_handle(cli, &quota_fnum))) {
+ status = cli_get_quota_handle(cli, &quota_fnum);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Quotas are not enabled on this share.\n");
d_printf("Failed to open %s %s.\n",
- FAKE_FILE_NAME_QUOTA_WIN32,cli_errstr(cli));
+ FAKE_FILE_NAME_QUOTA_WIN32,
+ nt_errstr(status));
return -1;
}