From: Volker Lendecke Date: Thu, 26 Mar 2020 13:24:14 +0000 (+0100) Subject: smbclient: Remove function set_remote_times() X-Git-Tag: ldb-2.2.0~954 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=268892f75c5a481ddad7cc0a25b3212c4d3f1d6d;p=thirdparty%2Fsamba.git smbclient: Remove function set_remote_times() This was just a wrapper around cli_setpathinfo_ext() with just one caller Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/client/client.c b/source3/client/client.c index fff67d4e920..671ddd8ab24 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -5180,41 +5180,6 @@ static int cmd_show_connect( void ) return 0; } -/** - * set_remote_times - set times of a remote file - * @filename: path to the file name - * @create_time: New create time - * @access_time: New access time - * @write_time: New write time - * @change_time: New metadata change time - * - * Update the file times with the ones provided. - */ -static int set_remote_times(const char *filename, - struct timespec *create_time, - struct timespec *access_time, - struct timespec *write_time, - struct timespec *change_time) -{ - extern struct cli_state *cli; - NTSTATUS status; - - status = cli_setpathinfo_ext(cli, - filename, - create_time, - access_time, - write_time, - change_time, - -1); - if (!NT_STATUS_IS_OK(status)) { - d_printf("cli_setpathinfo_basic failed: %s\n", - nt_errstr(status)); - return 1; - } - - return 0; -} - /** * cmd_utimes - interactive command to set the four times * @@ -5231,6 +5196,8 @@ static int cmd_utimes(void) int err = 0; bool ok; TALLOC_CTX *ctx = talloc_new(NULL); + NTSTATUS status; + if (ctx == NULL) { return 1; } @@ -5307,7 +5274,14 @@ static int cmd_utimes(void) timespec_string_buf(×[2], false, &tbuf[2]), timespec_string_buf(×[3], false, &tbuf[3]))); - set_remote_times(fname, ×[0], ×[1], ×[2], ×[3]); + status = cli_setpathinfo_ext( + cli, fname, ×[0], ×[1], ×[2], ×[3], -1); + if (!NT_STATUS_IS_OK(status)) { + d_printf("cli_setpathinfo_ext failed: %s\n", + nt_errstr(status)); + err = 1; + goto out; + } out: talloc_free(ctx); return err;