]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbclient: Remove function set_remote_times()
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2020 13:24:14 +0000 (14:24 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 8 Apr 2020 14:46:39 +0000 (14:46 +0000)
This was just a wrapper around cli_setpathinfo_ext() with just one
caller

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/client/client.c

index fff67d4e920ad125c8fdbb143d615b73c51cb9ae..671ddd8ab240fdaac6ce82e7bbe95e486aad8c36 100644 (file)
@@ -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(&times[2], false, &tbuf[2]),
                   timespec_string_buf(&times[3], false, &tbuf[3])));
 
-       set_remote_times(fname, &times[0], &times[1], &times[2], &times[3]);
+       status = cli_setpathinfo_ext(
+               cli, fname, &times[0], &times[1], &times[2], &times[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;