$NetBSD: patch-af,v 1.1 2001/05/22 11:37:17 wiz Exp $ --- ufile.c.orig Fri Jan 13 18:13:16 1995 +++ ufile.c @@ -135,7 +135,7 @@ int cp(from,to) char *from, *to; { - int f, g, amnt; + int f, g, amnt, rc; struct stat sbuf; #ifdef HAVEUTIME @@ -157,8 +157,8 @@ } while((amnt=read(f,stdbuf,stdsiz))>0) if(amnt!=write(g,stdbuf,amnt)) break; - close(f); close(g); - if(amnt) return -1; + close(f); rc = close(g); + if(amnt || rc) return -1; #ifdef HAVEUTIME #ifdef NeXT