summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcs.h
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2006-04-26 21:55:23 +0000
committerJoris Vink <joris@cvs.openbsd.org>2006-04-26 21:55:23 +0000
commitdf3a4e509cd581d1f7a20e485d02335219e83daf (patch)
tree624a5f81ee4938e5d6e948c5b9864f1921dcfcf4 /usr.bin/rcs/rcs.h
parent3822e490767df6f6d16147268ba0f10c37a1e54c (diff)
prevent file races by obtaining an fd for the RCS file and
do our operations on that, this is safe and guarantees we can operate on the file until we close(2) it. a fix is coming for the remaining races in our diff code. okay niallo@ and ray@
Diffstat (limited to 'usr.bin/rcs/rcs.h')
-rw-r--r--usr.bin/rcs/rcs.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/rcs/rcs.h b/usr.bin/rcs/rcs.h
index 4ae27d19e0b..adf7677bdc6 100644
--- a/usr.bin/rcs/rcs.h
+++ b/usr.bin/rcs/rcs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.h,v 1.1 2006/04/26 02:55:13 joris Exp $ */
+/* $OpenBSD: rcs.h,v 1.2 2006/04/26 21:55:22 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -190,6 +190,7 @@ struct rcs_delta {
typedef struct rcs_file {
+ int fd;
char *rf_path;
mode_t rf_mode;
u_int rf_flags;
@@ -209,11 +210,9 @@ typedef struct rcs_file {
void *rf_pdata;
} RCSFILE;
-
extern int rcs_errno;
-
-RCSFILE *rcs_open(const char *, int, ...);
+RCSFILE *rcs_open(const char *, int, int, ...);
void rcs_close(RCSFILE *);
const RCSNUM *rcs_head_get(RCSFILE *);
int rcs_head_set(RCSFILE *, RCSNUM *);
@@ -253,7 +252,6 @@ RCSNUM *rcs_tag_resolve(RCSFILE *, const char *);
const char *rcs_errstr(int);
int rcs_write(RCSFILE *);
-
int rcs_kflag_get(const char *);
void rcs_kflag_usage(void);
int rcs_kw_expand(RCSFILE *, u_char *, size_t, size_t *);
@@ -272,9 +270,7 @@ int rcsnum_cmp(const RCSNUM *, const RCSNUM *, u_int);
/* rcstime.c */
void rcs_set_tz(char *, struct rcs_delta *, struct tm *);
-
extern char *timezone_flag;
-
extern int rcsnum_flags;
#endif /* RCS_H */