Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/xlint lint: catch more write errors when copyi...



details:   https://anonhg.NetBSD.org/src/rev/b0eb3dfd4130
branches:  trunk
changeset: 373146:b0eb3dfd4130
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 21 11:29:30 2023 +0000

description:
lint: catch more write errors when copying files

diffstat:

 usr.bin/xlint/xlint/xlint.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r fbcd52b61170 -r b0eb3dfd4130 usr.bin/xlint/xlint/xlint.c
--- a/usr.bin/xlint/xlint/xlint.c       Sat Jan 21 11:22:21 2023 +0000
+++ b/usr.bin/xlint/xlint/xlint.c       Sat Jan 21 11:29:30 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.106 2023/01/21 11:22:21 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.107 2023/01/21 11:29:30 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: xlint.c,v 1.106 2023/01/21 11:22:21 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.107 2023/01/21 11:29:30 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -845,7 +845,7 @@
                                warn("read error on %s", src);
                                terminate(-1);
                        }
-                       if (write(ofd, buf, (size_t)rlen) == -1) {
+                       if (write(ofd, buf, (size_t)rlen) != rlen) {
                                warn("write error on %s", dest);
                                terminate(-1);
                        }



Home | Main Index | Thread Index | Old Index