summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-06-18 12:21:06 +0000
committerJeremy Allison <jra@samba.org>2014-06-30 22:28:14 +0200
commit379cbb6397ce6228cf02125f4f29b2438b384d1c (patch)
tree9ca15d4b93ca15a37d55dc8dd038bf6839725e49
parentdcd6373613622852181a4dacdcf92ec2b9cb0112 (diff)
downloadsamba-379cbb6397ce6228cf02125f4f29b2438b384d1c.tar.gz
samba-379cbb6397ce6228cf02125f4f29b2438b384d1c.tar.xz
samba-379cbb6397ce6228cf02125f4f29b2438b384d1c.zip
lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_time
Both take and return values now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--lib/util/time.c8
-rw-r--r--lib/util/time.h2
-rw-r--r--source3/lib/time.c2
-rw-r--r--source3/libsmb/cli_smb2_fnum.c6
-rw-r--r--source3/smbd/dosmode.c4
5 files changed, 11 insertions, 11 deletions
diff --git a/lib/util/time.c b/lib/util/time.c
index 0c30264ffb..03345ec8d1 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -134,7 +134,7 @@ struct timespec convert_time_t_to_timespec(time_t t)
**/
time_t nt_time_to_unix(NTTIME nt)
{
- return convert_timespec_to_time_t(nt_time_to_unix_timespec(&nt));
+ return convert_timespec_to_time_t(nt_time_to_unix_timespec(nt));
}
@@ -784,18 +784,18 @@ _PUBLIC_ int get_time_zone(time_t t)
return tm_diff(&tm_utc,tm);
}
-struct timespec nt_time_to_unix_timespec(const NTTIME *nt)
+struct timespec nt_time_to_unix_timespec(NTTIME nt)
{
int64_t d;
struct timespec ret;
- if (*nt == 0 || *nt == (int64_t)-1) {
+ if (nt == 0 || nt == (int64_t)-1) {
ret.tv_sec = 0;
ret.tv_nsec = 0;
return ret;
}
- d = (int64_t)*nt;
+ d = (int64_t)nt;
/* d is now in 100ns units, since jan 1st 1601".
Save off the ns fraction. */
diff --git a/lib/util/time.h b/lib/util/time.h
index f3ed29b301..8595bb0613 100644
--- a/lib/util/time.h
+++ b/lib/util/time.h
@@ -298,7 +298,7 @@ bool nt_time_equal(NTTIME *t1, NTTIME *t2);
void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second);
-struct timespec nt_time_to_unix_timespec(const NTTIME *nt);
+struct timespec nt_time_to_unix_timespec(NTTIME nt);
time_t convert_timespec_to_time_t(struct timespec ts);
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 98ab0c78d4..30ad1ec9a0 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -250,7 +250,7 @@ struct timespec interpret_long_date(const char *p)
ret.tv_nsec = 0;
return ret;
}
- return nt_time_to_unix_timespec(&nt);
+ return nt_time_to_unix_timespec(nt);
}
/*******************************************************************
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index e4dfbf319e..3fdd49a74f 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -822,9 +822,9 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
ZERO_STRUCTP(sbuf);
- sbuf->st_ex_atime = nt_time_to_unix_timespec(&cr.last_access_time);
- sbuf->st_ex_mtime = nt_time_to_unix_timespec(&cr.last_write_time);
- sbuf->st_ex_ctime = nt_time_to_unix_timespec(&cr.change_time);
+ sbuf->st_ex_atime = nt_time_to_unix_timespec(cr.last_access_time);
+ sbuf->st_ex_mtime = nt_time_to_unix_timespec(cr.last_write_time);
+ sbuf->st_ex_ctime = nt_time_to_unix_timespec(cr.change_time);
sbuf->st_ex_size = cr.end_of_file;
*attributes = cr.file_attributes;
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index b31b472e90..2e6871191b 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -319,7 +319,7 @@ static bool get_ea_dos_attribute(connection_struct *conn,
if (!null_nttime(dosattrib.info.info1.create_time)) {
struct timespec create_time =
nt_time_to_unix_timespec(
- &dosattrib.info.info1.create_time);
+ dosattrib.info.info1.create_time);
update_stat_ex_create_time(&smb_fname->st,
create_time);
@@ -341,7 +341,7 @@ static bool get_ea_dos_attribute(connection_struct *conn,
!null_nttime(dosattrib.info.info3.create_time)) {
struct timespec create_time =
nt_time_to_unix_timespec(
- &dosattrib.info.info3.create_time);
+ dosattrib.info.info3.create_time);
update_stat_ex_create_time(&smb_fname->st,
create_time);