From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mickerik.phytec.de ([195.145.39.210]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKPEA-0007kc-Rb for barebox@lists.infradead.org; Tue, 15 Oct 2019 15:59:16 +0000 From: Robert Karszniewicz Date: Tue, 15 Oct 2019 17:59:10 +0200 Message-Id: <1571155150-124984-1-git-send-email-r.karszniewicz@phytec.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] libfile: copy_file: prevent spurious error message To: barebox@lists.infradead.org Signed-off-by: Robert Karszniewicz --- lib/libfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libfile.c b/lib/libfile.c index 3f3ec21..319e66b 100644 --- a/lib/libfile.c +++ b/lib/libfile.c @@ -349,6 +349,7 @@ int copy_file(const char *src, const char *dst, int verbose) ret = stat(dst, &dststat); if (ret && ret != -ENOENT) goto out; + ret = 0; /* Set O_TRUNC only if file exist and is a regular file */ if (!ret && S_ISREG(dststat.st_mode)) -- 2.7.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox