On 3/2/20 3:28 PM, Ossama Othman wrote:
ell/path.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ell/path.c b/ell/path.c
index df5a703..e911c01 100644
@@ -162,8 +162,7 @@ LIB_EXPORT uint64_t l_path_get_mtime(const char *path)
if (ret < 0)
- return (uint64_t) sb.st_mtim.tv_sec * 1000000 +
- sb.st_mtim.tv_nsec / 1000;
+ return l_timespec_to_usecs(&sb.st_mtim);
So while theoretically possible to overflow, this is _highly_ unlikely.
I think we are looking at 35-36 bits of sec info, which is 1-2 thousand
years in the future.
I guess I'm ok if we try and deal with overflow just in case someone is
setting some really large mtime values as long as l_timespec_to_usecs
isn't overly expensive.