mirror of
https://github.com/samba-team/samba.git
synced 2025-11-08 16:23:49 +03:00
libsmb: Avoid a call to SMBC_errno()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
c9030fb5a8
commit
0b351cda24
@@ -601,7 +601,6 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path,
|
|||||||
uint16_t attr)
|
uint16_t attr)
|
||||||
{
|
{
|
||||||
uint16_t fd;
|
uint16_t fd;
|
||||||
int ret;
|
|
||||||
uint32_t lattr = (uint32_t)attr;
|
uint32_t lattr = (uint32_t)attr;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
TALLOC_CTX *frame = talloc_stackframe();
|
TALLOC_CTX *frame = talloc_stackframe();
|
||||||
@@ -655,10 +654,12 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set the new attributes */
|
/* Set the new attributes */
|
||||||
ret = NT_STATUS_IS_OK(cli_setattrE(srv->cli, fd,
|
status = cli_setattrE(
|
||||||
|
srv->cli,
|
||||||
|
fd,
|
||||||
change_time.tv_sec,
|
change_time.tv_sec,
|
||||||
access_time.tv_sec,
|
access_time.tv_sec,
|
||||||
write_time.tv_sec));
|
write_time.tv_sec);
|
||||||
|
|
||||||
/* Close the file */
|
/* Close the file */
|
||||||
cli_close(srv->cli, fd);
|
cli_close(srv->cli, fd);
|
||||||
@@ -669,13 +670,13 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path,
|
|||||||
* cli_setatr() for that, and with only this parameter, it
|
* cli_setatr() for that, and with only this parameter, it
|
||||||
* seems to work on win98.
|
* seems to work on win98.
|
||||||
*/
|
*/
|
||||||
if (ret && attr != (uint16_t) -1) {
|
if (NT_STATUS_IS_OK(status) && attr != (uint16_t) -1) {
|
||||||
ret = NT_STATUS_IS_OK(cli_setatr(srv->cli, path, (uint32_t)attr, 0));
|
status = cli_setatr(srv->cli, path, (uint32_t)attr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! ret) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
errno = SMBC_errno(context, srv->cli);
|
|
||||||
TALLOC_FREE(frame);
|
TALLOC_FREE(frame);
|
||||||
|
errno = cli_status_to_errno(status);
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user