summaryrefslogtreecommitdiffstats
path: root/lib/libstand/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libstand/open.c')
-rw-r--r--lib/libstand/open.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libstand/open.c b/lib/libstand/open.c
index 3a9127c..471f937 100644
--- a/lib/libstand/open.c
+++ b/lib/libstand/open.c
@@ -1,3 +1,4 @@
+/* $FreeBSD$ */
/* $NetBSD: open.c,v 1.16 1997/01/28 09:41:03 pk Exp $ */
/*-
@@ -79,6 +80,13 @@ o_gethandle(void)
return(-1);
}
+static void
+o_rainit(struct open_file *f)
+{
+ f->f_rabuf = malloc(SOPEN_RASIZE);
+ f->f_ralen = 0;
+ f->f_raoffset = 0;
+}
int
open(const char *fname, int mode)
@@ -118,6 +126,7 @@ open(const char *fname, int mode)
if (error == 0) {
f->f_ops = file_system[i];
+ o_rainit(f);
return (fd);
}
if (error != EINVAL)
OpenPOWER on IntegriCloud