diff options
author | Jeremy Allison <jra@samba.org> | 2006-02-10 01:43:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:01 -0500 |
commit | 687e5be25e6090cf73867c3e08dab6a381c0adbc (patch) | |
tree | 69f3b79fc39b88b7e0843b9019099e70915dd5c1 /source3/smbd | |
parent | e97ad44d55895d6f5d269b2c316329cbf66e15ac (diff) | |
download | samba-687e5be25e6090cf73867c3e08dab6a381c0adbc.tar.gz samba-687e5be25e6090cf73867c3e08dab6a381c0adbc.tar.bz2 samba-687e5be25e6090cf73867c3e08dab6a381c0adbc.zip |
r13423: Write wrapper functions (and configure tests) so we can
always assume we can get a struct timespec out of a stat
struct. This will allow us to portably move to nsec timestamps
on files and directories in the file server code in future.
Jeremy.
(This used to be commit 07132d8796a08aa71d6719cb07b5b2c999930632)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/notify_hash.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/source3/smbd/notify_hash.c b/source3/smbd/notify_hash.c index ee7d4314ee..859a92a61e 100644 --- a/source3/smbd/notify_hash.c +++ b/source3/smbd/notify_hash.c @@ -23,13 +23,8 @@ struct change_data { time_t last_check_time; /* time we last checked this entry */ -#ifdef HAVE_STAT_HIRES_TIMESTAMPS - struct timespec modify_time; - struct timespec status_time; -#else - time_t modify_time; /* Info from the directory we're monitoring. */ - time_t status_time; /* Info from the directory we're monitoring. */ -#endif + struct timespec modify_time; /* Info from the directory we're monitoring. */ + struct timespec status_time; /* Info from the directory we're monitoring. */ time_t total_time; /* Total time of all directory entries - don't care if it wraps. */ unsigned int num_entries; /* Zero or the number of files in the directory. */ unsigned int mode_sum; @@ -37,13 +32,8 @@ struct change_data { }; -#ifdef HAVE_STAT_HIRES_TIMESTAMPS /* Compare struct timespec. */ #define TIMESTAMP_NEQ(x, y) (((x).tv_sec != (y).tv_sec) || ((x).tv_nsec != (y).tv_nsec)) -#else -/* Compare time_t . */ -#define TIMESTAMP_NEQ(x, y) ((x) != (y)) -#endif /**************************************************************************** Create the hash we will use to determine if the contents changed. @@ -66,13 +56,8 @@ static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags, if(SMB_VFS_STAT(conn,path, &st) == -1) return False; -#ifdef HAVE_STAT_HIRES_TIMESTAMPS - data->modify_time = st.st_mtim; - data->status_time = st.st_ctim; -#else - data->modify_time = st.st_mtime; - data->status_time = st.st_ctime; -#endif + data->modify_time = get_mtimespec(&st); + data->status_time = get_ctimespec(&st); if (old_data) { /* |