PR/57735: Jose Louis Duran: check if fts_read(3) had an error.

(FreeBSD commit https://github.com/freebsd/freebsd-src/commit/\
    2dfa4b66b3d0caaaae6ce2df476b5615f8415a19)
This commit is contained in:
christos 2023-12-02 13:34:48 +00:00
parent 7580dafe31
commit 0d9ef1fe04
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: create.c,v 1.76 2018/11/18 23:03:36 sevan Exp $ */
/* $NetBSD: create.c,v 1.77 2023/12/02 13:34:48 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: create.c,v 1.76 2018/11/18 23:03:36 sevan Exp $");
__RCSID("$NetBSD: create.c,v 1.77 2023/12/02 13:34:48 christos Exp $");
#endif
#endif /* not lint */
@ -173,6 +173,8 @@ cwalk(FILE *fp)
}
}
if (errno != 0)
mtree_err("fts_read: %s", strerror(errno));
fts_close(t);
if (sflag && keys & F_CKSUM)
mtree_err("%s checksum: %u", fullpath, crc_total);

View File

@ -1,4 +1,4 @@
/* $NetBSD: verify.c,v 1.47 2021/03/18 20:02:18 cheusov Exp $ */
/* $NetBSD: verify.c,v 1.48 2023/12/02 13:34:48 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)verify.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: verify.c,v 1.47 2021/03/18 20:02:18 cheusov Exp $");
__RCSID("$NetBSD: verify.c,v 1.48 2023/12/02 13:34:48 christos Exp $");
#endif
#endif /* not lint */
@ -166,6 +166,8 @@ vwalk(void)
}
fts_set(t, p, FTS_SKIP);
}
if (errno != 0)
mtree_err("fts_read: %s", strerror(errno));
fts_close(t);
if (sflag)
warnx("%s checksum: %u", fullpath, crc_total);