aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/wutil.cpp
diff options
context:
space:
mode:
authorGravatar Aaron Gyes <me@aaron.gy>2016-04-02 22:19:44 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-04-04 20:17:05 -0700
commita4642f141f7781792909cff385ff2316530416ee (patch)
treeb9312944977d9cafee9ae73c4134627f787c309b /src/wutil.cpp
parent8f33b55ccc501f8460d4d5ff8bd5ef7861a0ee3a (diff)
don't try to use st_gen (inode generation) number
Per discussion in pull-request #2891, it's not available on Linux (we just fill it with zero), and unless run as root on OS X (or other BSD system) it will be zero. Remove it from file_id_t. Also fix the initialization of the file_id_t structure. Fixes #2891
Diffstat (limited to 'src/wutil.cpp')
-rw-r--r--src/wutil.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/wutil.cpp b/src/wutil.cpp
index a4494470..0b11989a 100644
--- a/src/wutil.cpp
+++ b/src/wutil.cpp
@@ -28,7 +28,7 @@
typedef std::string cstring;
-const file_id_t kInvalidFileID = {(dev_t)-1LL, (ino_t)-1LL, (uint64_t)-1LL, -1, -1, (uint32_t)-1};
+const file_id_t kInvalidFileID = {(dev_t)-1LL, (ino_t)-1LL, (uint64_t)-1LL, -1, -1, -1, -1};
#ifndef PATH_MAX
#ifdef MAXPATHLEN
@@ -555,12 +555,7 @@ file_id_t file_id_t::file_id_from_stat(const struct stat *buf)
result.change_nanoseconds = 0;
result.mod_nanoseconds = 0;
#endif
-
-#if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
- result.generation = buf->st_gen;
-#else
- result.generation = 0;
-#endif
+
return result;
}
@@ -619,7 +614,6 @@ int file_id_t::compare_file_id(const file_id_t &rhs) const
if (! ret) ret = compare(device, rhs.device);
if (! ret) ret = compare(inode, rhs.inode);
if (! ret) ret = compare(size, rhs.size);
- if (! ret) ret = compare(generation, rhs.generation);
if (! ret) ret = compare(change_seconds, rhs.change_seconds);
if (! ret) ret = compare(change_nanoseconds, rhs.change_nanoseconds);
if (! ret) ret = compare(mod_seconds, rhs.mod_seconds);