diff options
author | Jeremy Allison <jra@samba.org> | 2001-08-20 22:13:53 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-08-20 22:13:53 +0000 |
commit | c786a4d89a3c4b7f2c6fdf0762e835ad7edbd664 (patch) | |
tree | ca4c01a25d614da1d162ea76ebd023a6a20ef304 | |
parent | 68525e9021832a74608f2dc3e0247317e713e384 (diff) | |
download | samba-c786a4d89a3c4b7f2c6fdf0762e835ad7edbd664.tar.gz samba-c786a4d89a3c4b7f2c6fdf0762e835ad7edbd664.tar.bz2 samba-c786a4d89a3c4b7f2c6fdf0762e835ad7edbd664.zip |
Ensure we are very explicit about what we're comparing when
we're comparing structures (ie. don't just do a memcmp). I
don't think this will fix the fcntl spin issue, but it's a
"just in case" change.
Jeremy.
(This used to be commit 41066208ad8ca20d35a32bdf9ad934e11465c8f1)
-rw-r--r-- | source3/locking/locking.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 9b393ed6ba..ee3ce7c7d4 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -448,8 +448,8 @@ size_t del_share_mode(files_struct *fsp, share_mode_entry **ppse) from the record */ for (i=0;i<data->num_share_mode_entries;) { if (shares[i].pid == pid && - memcmp(&shares[i].time, - &fsp->open_time,sizeof(struct timeval)) == 0) { + shares[i].time.tv_sec == fsp->open_time.tv_sec && + shares[i].time.tv_usec == fsp->open_time.tv_usec ) { *ppse = memdup(&shares[i], sizeof(*shares)); data->num_share_mode_entries--; memmove(&shares[i], &shares[i+1], @@ -566,8 +566,8 @@ static BOOL mod_share_mode(files_struct *fsp, for (i=0;i<data->num_share_mode_entries;i++) { if (pid == shares[i].pid && shares[i].share_mode == fsp->share_mode && - memcmp(&shares[i].time, - &fsp->open_time,sizeof(struct timeval)) == 0) { + shares[i].time.tv_sec == fsp->open_time.tv_sec && + shares[i].time.tv_usec == fsp->open_time.tv_usec ) { mod_fn(&shares[i], fsp->dev, fsp->inode, param); need_store=1; } |