diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-04-11 07:52:35 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-04-11 07:52:35 +0000 |
commit | e2440a5fd61070583aa16b2ee475e8e036f1ce3c (patch) | |
tree | 0b25e89942c841a939d6cb2d1c467b378549a242 | |
parent | ecf410c6540dd8c6bbb0307f870c9b7aab00ab44 (diff) |
Don't close() before fatal().
OK joris@, niallo@, and xsa@.
-rw-r--r-- | usr.bin/cvs/proto.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index 885c7afbb2c..aeb30a6450c 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.94 2006/04/05 01:38:55 ray Exp $ */ +/* $OpenBSD: proto.c,v 1.95 2006/04/11 07:52:34 ray Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -520,10 +520,8 @@ cvs_sendfile(struct cvsroot *root, const char *path) cvs_sendln(root, buf); while ((ret = read(fd, buf, sizeof(buf))) != 0) { - if (ret == -1) { - (void)close(fd); + if (ret == -1) fatal("cvs_sendfile: read error on '%s'", path); - } cvs_sendraw(root, buf, (size_t)ret); } |