]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Make cli_setpathinfo_ext() take structs instead of pointers
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2020 13:33:58 +0000 (14:33 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 8 Apr 2020 14:46:39 +0000 (14:46 +0000)
This simplifies the next commit: With direct (small) structs on the
stack we don't need declared variables in the callers

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

index 671ddd8ab240fdaac6ce82e7bbe95e486aad8c36..09456483c9524735d63217200e3d4a981ae0dc60 100644 (file)
@@ -5275,7 +5275,7 @@ static int cmd_utimes(void)
                   timespec_string_buf(&times[3], false, &tbuf[3])));
 
        status = cli_setpathinfo_ext(
-               cli, fname, &times[0], &times[1], &times[2], &times[3], -1);
+               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));
index 71c7b97ad54c6135f75b32b5741c04a0a6c3e15c..d0cdaef716d167ba1976e347b2d8022aa19ab175 100644 (file)
@@ -796,10 +796,10 @@ NTSTATUS cli_setpathinfo_basic(struct cli_state *cli, const char *fname,
 }
 
 NTSTATUS cli_setpathinfo_ext(struct cli_state *cli, const char *fname,
-                            const struct timespec *create_time,
-                            const struct timespec *access_time,
-                            const struct timespec *write_time,
-                            const struct timespec *change_time,
+                            struct timespec create_time,
+                            struct timespec access_time,
+                            struct timespec write_time,
+                            struct timespec change_time,
                             uint16_t mode)
 {
        unsigned int data_len = 0;
@@ -811,16 +811,20 @@ NTSTATUS cli_setpathinfo_ext(struct cli_state *cli, const char *fname,
        /*
         * Add the create, last access, modification, and status change times
         */
-       put_long_date_full_timespec(TIMESTAMP_SET_NT_OR_BETTER, p, create_time);
+       put_long_date_full_timespec(
+               TIMESTAMP_SET_NT_OR_BETTER, p, &create_time);
        p += 8;
 
-       put_long_date_full_timespec(TIMESTAMP_SET_NT_OR_BETTER, p, access_time);
+       put_long_date_full_timespec(
+               TIMESTAMP_SET_NT_OR_BETTER, p, &access_time);
        p += 8;
 
-       put_long_date_full_timespec(TIMESTAMP_SET_NT_OR_BETTER, p, write_time);
+       put_long_date_full_timespec(
+               TIMESTAMP_SET_NT_OR_BETTER, p, &write_time);
        p += 8;
 
-       put_long_date_full_timespec(TIMESTAMP_SET_NT_OR_BETTER, p, change_time);
+       put_long_date_full_timespec(
+               TIMESTAMP_SET_NT_OR_BETTER, p, &change_time);
        p += 8;
 
        if (mode == (uint16_t)-1 || mode == FILE_ATTRIBUTE_NORMAL) {
index b259feffd70b7ce37f7e4a30ce8c2d8a8235e0e7..97150f65ee36386eefe2665ddd39252cd7949d76 100644 (file)
@@ -65,10 +65,10 @@ NTSTATUS cli_setpathinfo_basic(struct cli_state *cli, const char *fname,
                               time_t change_time,
                               uint16_t mode);
 NTSTATUS cli_setpathinfo_ext(struct cli_state *cli, const char *fname,
-                            const struct timespec *create_time,
-                            const struct timespec *access_time,
-                            const struct timespec *write_time,
-                            const struct timespec *change_time,
+                            struct timespec create_time,
+                            struct timespec access_time,
+                            struct timespec write_time,
+                            struct timespec change_time,
                             uint16_t mode);
 struct tevent_req *cli_qpathinfo2_send(TALLOC_CTX *mem_ctx,
                                       struct tevent_context *ev,