File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ agent_cleanup_stale(const char *homedir, int ignore_hosthash)
270270 struct dirent * dp ;
271271 struct stat sb ;
272272 char * prefix = NULL , * dirpath , * path ;
273- struct timespec now , sub ;
273+ struct timespec now , sub , * mtimp = NULL ;
274274
275275 /* Only consider sockets last modified > 1 hour ago */
276276 if (clock_gettime (CLOCK_REALTIME , & now ) != 0 ) {
@@ -309,7 +309,14 @@ agent_cleanup_stale(const char *homedir, int ignore_hosthash)
309309 }
310310 if (!S_ISSOCK (sb .st_mode ))
311311 continue ;
312- if (timespeccmp (& sb .st_mtim , & now , > )) {
312+ #ifdef HAVE_STRUCT_STAT_ST_MTIM
313+ mtimp = & sb .st_mtim ;
314+ #else
315+ sub .tv_sec = sb .st_mtime ;
316+ sub .tv_nsec = 0 ;
317+ mtimp = & sub ;
318+ #endif
319+ if (timespeccmp (mtimp , & now , > )) {
313320 debug3_f ("Ignoring recent socket \"%s/%s\"" ,
314321 dirpath , dp -> d_name );
315322 continue ;
You can’t perform that action at this time.
0 commit comments