]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
install: Assorted nitpickery.
authorDag-Erling Smørgrav <des@FreeBSD.org>
Wed, 17 Apr 2024 01:36:42 +0000 (03:36 +0200)
committerDag-Erling Smørgrav <des@FreeBSD.org>
Wed, 17 Apr 2024 02:03:31 +0000 (04:03 +0200)
commit000a533e6d1db9878296b32d1cc212e11a2cc718
tree378b345615120978e514e92af30bb06c8da71a5f
parenta0439a1b820fa0e742c00d095f5f5c06f5f19432
install: Assorted nitpickery.

* Use `errc()` instead of manually setting `errno` before calling `err()`.
* Change one warning into a fatal error.
* Drop some unnecessary casts.
* `strlcat()` bounds checks were off-by-one.  This does not matter in
  practice because the subsequent code renders an overrun harmless.
* We were passing `SSIZE_MAX` to `copy_file_range()` instead of the
  requested size.  This only matters if we're asked to install a file
  which is still being written to while we are copying it.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44810
usr.bin/xinstall/xinstall.c