aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Aaron Gyes <me@aaron.gy>2016-06-12 03:39:36 -0700
committerGravatar Aaron Gyes <me@aaron.gy>2016-06-12 03:52:58 -0700
commitb72ed1fa8c7b44c6cacf0da9348d2c0d10f5ca70 (patch)
tree8d4fa91d7343acfcb1f0e554150777a59583dee3
parent3a7719015d1c33f326b613449957a54855c939de (diff)
Fix env_universal_common.cpp filesize comparisons.
* if (result == ULLONG_MAX) is always false, likely a typo as result is unsigned long, and the comment says ULONG_MAX. * use off_t instead of size_t for file size where it can mismatch st_size's type in stat.h
-rw-r--r--src/env_universal_common.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/env_universal_common.cpp b/src/env_universal_common.cpp
index c1b7c46c..6808558f 100644
--- a/src/env_universal_common.cpp
+++ b/src/env_universal_common.cpp
@@ -1023,7 +1023,7 @@ class universal_notifier_shmem_poller_t : public universal_notifier_t {
}
// Get the size.
- size_t size = 0;
+ off_t size = 0;
if (!errored) {
struct stat buf = {};
if (fstat(fd, &buf) < 0) {
@@ -1352,7 +1352,7 @@ class universal_notifier_named_pipe_t : public universal_notifier_t {
// Now return the smaller of the two values. If we get ULONG_MAX, it means there's no more
// need to poll; in that case return 0.
unsigned long result = mini(readback_delay, polling_delay);
- if (result == ULLONG_MAX) {
+ if (result == ULONG_MAX) {
result = 0;
}
return result;