NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59210



The following reply was made to PR bin/59210; it has been noted by GNATS.

From: Collin Funk <collin.funk1%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost, Christos Zoulas <christos%netbsd.org@localhost>
Cc: 
Subject: Re: bin/59210
Date: Sat, 14 Jun 2025 11:03:26 -0700

 > On OpenBSD, an autoconf test suite case failed because 'test file1 -ot ft' with /bin/ksh's test builtin does not support nanosecond timestamps.
 > 
 > The patch I sent was pushed on OpenBSD. Here is one for NetBSD which also has the issue.
 > 
 > $ cvs diff  -u -N bin/ksh/c_test.c
 > Index: bin/ksh/c_test.c
 > ===================================================================
 > RCS file: /cvsroot/src/bin/ksh/c_test.c,v
 > retrieving revision 1.10
 > diff -u -r1.10 c_test.c
 > --- bin/ksh/c_test.c	16 Sep 2021 19:44:01 -0000	1.10
 > +++ bin/ksh/c_test.c	25 Mar 2025 01:16:51 -0000
 > @@ -402,7 +402,9 @@
 >  			 */
 >  			return stat(opnd1, &b1) == 0
 >  				&& (((s2 = stat(opnd2, &b2)) == 0
 > -				      && b1.st_mtime > b2.st_mtime) || s2 < 0);
 > +				      && timespeccmp(&b1.st_mtim,
 > +						     &b2.st_mtim, >))
 > +				      || s2 != 0);
 >  		}
 >  	  case TO_FILOT: /* -ot */
 >  		{
 > @@ -412,7 +414,9 @@
 >  			 */
 >  			return stat(opnd2, &b2) == 0
 >  				&& (((s1 = stat(opnd1, &b1)) == 0
 > -				      && b1.st_mtime < b2.st_mtime) || s1 < 0);
 > +				      && timespeccmp(&b1.st_mtim,
 > +						     &b2.st_mtim, <))
 > +				      || s1 != 0);
 >  		}
 >  	  case TO_FILEQ: /* -ef */
 >  		return stat (opnd1, &b1) == 0 && stat (opnd2, &b2) == 0
 
 Hey Christos,
 
 This patch seems like an obvious improvement that got lost in the noise
 of other bug reports.
 
 Could you please check it?
 
 Collin
 


Home | Main Index | Thread Index | Old Index