diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-08 08:43:42 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-09 21:04:50 +0000 |
commit | abc17b0f8997ab07ae66130edd5dc8c43e72c886 (patch) | |
tree | 88056839c808a9f7f8c58f55ebe273aa7b5facdb /toxcore/Messenger.c | |
parent | 4e21c065517d6e125cb1d1b9a13e886b3046b0d8 (diff) |
Factor out time keeping code into its own module: mono_time.c.
It turns out, `unix_time` is also monotonic, and is used as such, so I've
renamed the new functions to `mono_time_*`.
2018-07-08:
```
00:01 <@irungentoo> the idea used to be that the unix_time() function
could go backward in time but I think I might have started using it like
if it could not after I changed it so that it would never go back in time
```
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 404827c6..a5d15a34 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <time.h> | 34 | #include <time.h> |
35 | 35 | ||
36 | #include "logger.h" | 36 | #include "logger.h" |
37 | #include "mono_time.h" | ||
37 | #include "network.h" | 38 | #include "network.h" |
38 | #include "state.h" | 39 | #include "state.h" |
39 | #include "util.h" | 40 | #include "util.h" |
@@ -1764,8 +1765,8 @@ static int handle_filecontrol(Messenger *m, int32_t friendnumber, uint8_t receiv | |||
1764 | 1765 | ||
1765 | if (position >= ft->size) { | 1766 | if (position >= ft->size) { |
1766 | LOGGER_DEBUG(m->log, | 1767 | LOGGER_DEBUG(m->log, |
1767 | "file control (friend %d, file %d): seek position %lld exceeds file size %lld", | 1768 | "file control (friend %d, file %d): seek position %ld exceeds file size %ld", |
1768 | friendnumber, filenumber, (unsigned long long)position, (unsigned long long)ft->size); | 1769 | friendnumber, filenumber, (unsigned long)position, (unsigned long)ft->size); |
1769 | return -1; | 1770 | return -1; |
1770 | } | 1771 | } |
1771 | 1772 | ||