From: Greg Hudson Date: Fri, 20 Feb 2009 19:13:00 +0000 (+0000) Subject: In krcp, check the return value when closing the output file after X-Git-Tag: krb5-1.8-alpha1~620 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0510fa4955b698a71bb49c868c2438d5941fa694;p=krb5.git 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 --- 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;