git: f070188c3ad6 - main - cp: Use warnc().

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Wed, 17 Apr 2024 02:08:49 UTC
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=f070188c3ad6b87ee9ce220b21718333d1bd9d52

commit f070188c3ad6b87ee9ce220b21718333d1bd9d52
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-04-17 02:07:20 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-04-17 02:08:38 +0000

    cp: Use warnc().
    
    MFC after:      1 week
    Sponsored by:   Klara, Inc.
---
 bin/cp/cp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 98697ba2b06f..823376964bd1 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -287,8 +287,7 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat)
 		case FTS_NS:
 		case FTS_DNR:
 		case FTS_ERR:
-			warnx("%s: %s",
-			    curr->fts_path, strerror(curr->fts_errno));
+			warnc(curr->fts_errno, "%s", curr->fts_path);
 			badcp = rval = 1;
 			continue;
 		case FTS_DC:			/* Warn, continue. */