From: reyk Date: Fri, 21 Apr 2017 11:02:10 +0000 (+0000) Subject: Fail if vm.conf exists but cannot be opened, ignore if it doesn't exist. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8d6f4d1bb411190c1546cfe7635854010420d7ef;p=openbsd Fail if vm.conf exists but cannot be opened, ignore if it doesn't exist. This fixes 'vmd -nf /etv/vm.conf' if the file is not readable. --- diff --git a/usr.sbin/vmd/parse.y b/usr.sbin/vmd/parse.y index 6b35f95a37c..440f7ebdf2d 100644 --- a/usr.sbin/vmd/parse.y +++ b/usr.sbin/vmd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.26 2017/04/21 07:03:26 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.27 2017/04/21 11:02:10 reyk Exp $ */ /* * Copyright (c) 2007-2016 Reyk Floeter @@ -959,7 +959,9 @@ parse_config(const char *filename) if ((file = pushfile(filename, 0)) == NULL) { log_warn("failed to open %s", filename); - return (0); + if (errno == ENOENT) + return (0); + return (-1); } topfile = file; setservent(1);