summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2017-06-10 23:41:25 +1000
committerDamien Miller <djm@mindrot.org>2017-06-10 23:41:25 +1000
commitbcd1485075aa72ba9418003f5cc27af2b049c51b (patch)
tree122b7024821c2c47b6df71639fe578bf5f571183 /defines.h
parent072e172f1d302d2a2c6043ecbfb4004406717b96 (diff)
portability for sftp globbed ls sort by mtime
Include replacement timespeccmp() for systems that lack it. Support time_t struct stat->st_mtime in addition to timespec stat->st_mtim, as well as unsorted fallback.
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/defines.h b/defines.h
index 0420a7e8e..f1662edcf 100644
--- a/defines.h
+++ b/defines.h
@@ -519,6 +519,13 @@ struct winsize {
519} 519}
520#endif 520#endif
521 521
522#ifndef timespeccmp
523#define timespeccmp(tsp, usp, cmp) \
524 (((tsp)->tv_sec == (usp)->tv_sec) ? \
525 ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \
526 ((tsp)->tv_sec cmp (usp)->tv_sec))
527#endif
528
522#ifndef __P 529#ifndef __P
523# define __P(x) x 530# define __P(x) x
524#endif 531#endif