diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2007-11-17 16:47:22 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2007-11-17 16:47:22 +0000 |
commit | 99b19921828b2abeb7adf8e96018d6d827fcf67e (patch) | |
tree | be50e376afdfe398cf0822aad013523fe095e130 /usr.bin | |
parent | 4e640df4538831a1295dfe8e9151e0bc89369a7e (diff) |
Use mtimespec instead of mtime when comparing the timestamp of the edited
file. OK miod@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/chpass/edit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c index a013cd79f83..49ef819de56 100644 --- a/usr.bin/chpass/edit.c +++ b/usr.bin/chpass/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.30 2007/03/20 03:50:38 tedu Exp $ */ +/* $OpenBSD: edit.c,v 1.31 2007/11/17 16:47:21 millert Exp $ */ /* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: edit.c,v 1.30 2007/03/20 03:50:38 tedu Exp $"; +static char rcsid[] = "$OpenBSD: edit.c,v 1.31 2007/11/17 16:47:21 millert Exp $"; #endif #endif /* not lint */ @@ -66,7 +66,7 @@ edit(char *tempname, struct passwd *pw) pw_edit(1, tempname); if (lstat(tempname, &end) == -1 || S_ISLNK(end.st_mode)) return (EDIT_ERROR); - if (begin.st_mtime == end.st_mtime && + if (!timespeccmp(&begin.st_mtimespec, &end.st_mtimespec, -) && begin.st_size == end.st_size) { warnx("no changes made"); return (EDIT_NOCHANGE); |