From 0510fa4955b698a71bb49c868c2438d5941fa694 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 20 Feb 2009 19:13:00 +0000 Subject: [PATCH] In krcp, check the return value when closing the output file after successfully writing it. close cannot return an error status on most local filesystems, but can on some network filesystems such as AFS or NFS. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22043 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/krcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/appl/bsd/krcp.c b/src/appl/bsd/krcp.c index a5370a297..eed615ffa 100644 --- a/src/appl/bsd/krcp.c +++ b/src/appl/bsd/krcp.c @@ -1115,7 +1115,8 @@ void sink(argc, argv) wrerr++; if (ftruncate(of, size)) error("rcp: can't truncate %s: %s\n", nambuf, error_message(errno)); - (void) close(of); + if (close(of) != 0) + error("rcp: error closing %s: %s\n", nambuf, error_message(errno)); (void) response(); if (setimes) { setimes = 0; -- 2.26.2