summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-08-24 16:44:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:48 -0500
commita64925ddff467a47f7adfac4b1b977ddc0c7f4ef (patch)
tree0c228a2046097065d34dc62a744747509689e09c /source3/torture
parent26f55cb40de4556774ac3a4ef0e46003d85477a4 (diff)
downloadsamba-a64925ddff467a47f7adfac4b1b977ddc0c7f4ef.tar.gz
samba-a64925ddff467a47f7adfac4b1b977ddc0c7f4ef.tar.bz2
samba-a64925ddff467a47f7adfac4b1b977ddc0c7f4ef.zip
r17800: Start using struct timespec internally for file times
on the wire. This allows us to go to nsec resolution for systems that support it. It should also now be easy to add a correct "create time" (birth time) for systems that support it (*BSD). I'll be watching the build farm closely after this one for breakage :-). Jeremy. (This used to be commit 425280a1d23f97ef0b0be77462386d619f47b21d)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index ba13897773..59d6fa0113 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -2467,7 +2467,8 @@ static BOOL run_trans2test(int dummy)
struct cli_state *cli;
int fnum;
SMB_OFF_T size;
- time_t c_time, a_time, m_time, w_time, m_time2;
+ time_t c_time, a_time, m_time, m_time2;
+ struct timespec c_time_ts, a_time_ts, m_time_ts, w_time_ts, m_time2_ts;
const char *fname = "\\trans2.tst";
const char *dname = "\\trans2";
const char *fname2 = "\\trans2\\trans2.tst";
@@ -2483,8 +2484,8 @@ static BOOL run_trans2test(int dummy)
cli_unlink(cli, fname);
fnum = cli_open(cli, fname,
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
- if (!cli_qfileinfo(cli, fnum, NULL, &size, &c_time, &a_time, &m_time,
- NULL, NULL)) {
+ if (!cli_qfileinfo(cli, fnum, NULL, &size, &c_time_ts, &a_time_ts, &w_time_ts,
+ &m_time_ts, NULL)) {
printf("ERROR: qfileinfo failed (%s)\n", cli_errstr(cli));
correct = False;
}
@@ -2539,13 +2540,13 @@ static BOOL run_trans2test(int dummy)
fnum = cli_open(cli, fname,
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
cli_close(cli, fnum);
- if (!cli_qpathinfo2(cli, fname, &c_time, &a_time, &w_time,
- &m_time, &size, NULL, NULL)) {
+ if (!cli_qpathinfo2(cli, fname, &c_time_ts, &a_time_ts, &w_time_ts,
+ &m_time_ts, &size, NULL, NULL)) {
printf("ERROR: qpathinfo2 failed (%s)\n", cli_errstr(cli));
correct = False;
} else {
- if (w_time < 60*60*24*2) {
- printf("write time=%s", ctime(&w_time));
+ if (w_time_ts.tv_sec < 60*60*24*2) {
+ printf("write time=%s", ctime(&w_time_ts.tv_sec));
printf("This system appears to set a initial 0 write time\n");
correct = False;
}
@@ -2561,8 +2562,8 @@ static BOOL run_trans2test(int dummy)
correct = False;
}
sleep(3);
- if (!cli_qpathinfo2(cli, "\\trans2\\", &c_time, &a_time, &w_time,
- &m_time, &size, NULL, NULL)) {
+ if (!cli_qpathinfo2(cli, "\\trans2\\", &c_time_ts, &a_time_ts, &w_time_ts,
+ &m_time_ts, &size, NULL, NULL)) {
printf("ERROR: qpathinfo2 failed (%s)\n", cli_errstr(cli));
correct = False;
}
@@ -2571,8 +2572,8 @@ static BOOL run_trans2test(int dummy)
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
cli_write(cli, fnum, 0, (char *)&fnum, 0, sizeof(fnum));
cli_close(cli, fnum);
- if (!cli_qpathinfo2(cli, "\\trans2\\", &c_time, &a_time, &w_time,
- &m_time2, &size, NULL, NULL)) {
+ if (!cli_qpathinfo2(cli, "\\trans2\\", &c_time_ts, &a_time_ts, &w_time_ts,
+ &m_time2_ts, &size, NULL, NULL)) {
printf("ERROR: qpathinfo2 failed (%s)\n", cli_errstr(cli));
correct = False;
} else {