[hackers] [sbase] Use st_mtime as opposed to st_mtim.tv_sec || sin

From: <git_AT_suckless.org>
Date: Fri, 20 Feb 2015 17:01:33 +0100 (CET)

commit 88da51135de0d1449342c95fba70bc536e4a8f9c
Author: sin <sin_AT_2f30.org>
Date: Fri Feb 20 15:47:50 2015 +0000

    Use st_mtime as opposed to st_mtim.tv_sec
    
    This is more portable and fixes a build issue on NetBSD. We ignore
    nanoseconds in this case so there's no functional difference.

diff --git a/find.c b/find.c
index bbdf98e..257b4a9 100644
--- a/find.c
+++ b/find.c
_AT_@ -458,7 +458,7 @@ pri_print(Arg *arg)
 static int
 pri_newer(Arg *arg)
 {
- return arg->st->st_mtim.tv_sec > (time_t)arg->extra.i;
+ return arg->st->st_mtime > (time_t)arg->extra.i;
 }
 
 static int
_AT_@ -677,7 +677,7 @@ get_newer_arg(char **argv, Extra *extra)
         if (stat(*argv, &st))
                 eprintf("failed to stat '%s':", *argv);
 
- extra->i = st.st_mtim.tv_sec;
+ extra->i = st.st_mtime;
         return argv;
 }
 
Received on Fri Feb 20 2015 - 17:01:33 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 20 2015 - 17:12:14 CET