From owner-freebsd-bugs Thu Aug 7 04:49:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA03956 for bugs-outgoing; Thu, 7 Aug 1997 04:49:21 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA03936 for ; Thu, 7 Aug 1997 04:48:14 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id VAA27339; Thu, 7 Aug 1997 21:21:01 +1000 Date: Thu, 7 Aug 1997 21:21:01 +1000 From: Bruce Evans Message-Id: <199708071121.VAA27339@godzilla.zeta.org.au> To: freebsd-bugs@hub.freebsd.org, j@uriah.heep.sax.de Subject: Re: bin/4238: chpass only occasionally works in conjunction with ed Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > UTSL. You could have easily found the reason yourself: > > if (begin.st_mtime == end.st_mtime) { > warnx("no changes made"); > pw_error(NULL, 0, 0); > } > > That is, the editing process needs to last for at least one second > right now, in order for chpass(1) to notice the modification on the > file since it's only done using the file modification timestamp. Gak. Tests based on timestamps will break when the hardare becomes a little faster. The above test broke about 20 years ago. > Fix: include st_mtimensec into the consideration. Won't work; ufs usually writes 0 to the nsec field when it changes a timestamp. The only exception is that the timestamps for utimes() have a resolution of 1 usec. Bruce