=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rcs/rcs.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- src/usr.bin/rcs/rcs.c 2010/10/15 08:44:12 1.68 +++ src/usr.bin/rcs/rcs.c 2010/10/20 19:53:53 1.69 @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.68 2010/10/15 08:44:12 tobias Exp $ */ +/* $OpenBSD: rcs.c,v 1.69 2010/10/20 19:53:53 tobias Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -185,7 +185,10 @@ rfp->rf_path = xstrdup(path); rfp->rf_flags = flags | RCS_SLOCK | RCS_SYNCED; rfp->rf_mode = fmode; - rfp->rf_fd = fd; + if (fd == -1) + rfp->rf_file = NULL; + else if ((rfp->rf_file = fdopen(fd, "r")) == NULL) + err(1, "rcs_open: fdopen: `%s'", path); TAILQ_INIT(&(rfp->rf_delta)); TAILQ_INIT(&(rfp->rf_access)); @@ -260,6 +263,8 @@ if (rfp->rf_branch != NULL) rcsnum_free(rfp->rf_branch); + if (rfp->rf_file != NULL) + fclose(rfp->rf_file); if (rfp->rf_path != NULL) xfree(rfp->rf_path); if (rfp->rf_comment != NULL)