$NetBSD: patch-aa,v 1.1 2002/05/09 01:40:04 enami Exp $

--- util.c.orig	Sat Apr  6 22:48:03 2002
+++ util.c
@@ -83,8 +83,11 @@
 		}
 	}
 
-	close(fd2);
 	close(fd1);
+	if (close(fd2) == -1) {
+		unlink(dest);
+		return -1;
+	}
 	return 0;
 }
 
