aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/config/config.y
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2005-10-27 17:13:23 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2005-10-27 17:13:23 +0000
commitdfdbf9be00e3caddb174ecc389dc7944be32741f (patch)
tree423a0bffe2fa7e681c7f2dd245f1856a9aa8ce9c /usr.sbin/config/config.y
parent518bf2dcc7112550797dfbbf056010d77deb8ff7 (diff)
Notes
Diffstat (limited to 'usr.sbin/config/config.y')
-rw-r--r--usr.sbin/config/config.y16
1 files changed, 16 insertions, 0 deletions
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index 018ec6197606..58d6b0cc4a37 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -92,6 +92,7 @@ int maxusers;
#define ns(s) strdup(s)
int include(const char *, int);
void yyerror(const char *s);
+int yywrap(void);
static char *
devopt(char *dev)
@@ -300,6 +301,21 @@ yyerror(const char *s)
errx(1, "%s:%d: %s", yyfile, yyline + 1, s);
}
+int
+yywrap(void)
+{
+
+ if (found_defaults) {
+ if (freopen(PREFIX, "r", stdin) == NULL)
+ err(2, "%s", PREFIX);
+ yyfile = PREFIX;
+ yyline = 0;
+ found_defaults = 0;
+ return 0;
+ }
+ return 1;
+}
+
/*
* Add a new file to the list of files.
*/