diff options
author | Damien Miller <djm@mindrot.org> | 2017-06-10 15:41:25 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-06-10 15:41:25 +0200 |
commit | bcd1485075aa72ba9418003f5cc27af2b049c51b (patch) | |
tree | 122b7024821c2c47b6df71639fe578bf5f571183 /defines.h | |
parent | upstream commit (diff) | |
download | openssh-bcd1485075aa72ba9418003f5cc27af2b049c51b.tar.xz openssh-bcd1485075aa72ba9418003f5cc27af2b049c51b.zip |
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.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -519,6 +519,13 @@ struct winsize { } #endif +#ifndef timespeccmp +#define timespeccmp(tsp, usp, cmp) \ + (((tsp)->tv_sec == (usp)->tv_sec) ? \ + ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ + ((tsp)->tv_sec cmp (usp)->tv_sec)) +#endif + #ifndef __P # define __P(x) x #endif |