aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/conf.c b/conf.c
index a06a3e7..dd705e0 100644
--- a/conf.c
+++ b/conf.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: conf.c,v 1.114 2012/12/17 23:54:57 okan Exp $
+ * $OpenBSD: conf.c,v 1.115 2012/12/18 00:14:41 okan Exp $
*/
#include <sys/param.h>
@@ -166,7 +166,8 @@ conf_init(struct conf *c)
{
int i;
- c->flags = 0;
+ bzero(c, sizeof(*c));
+
c->bwidth = CONF_BWIDTH;
c->mamount = CONF_MAMOUNT;
c->snapdist = CONF_SNAPDIST;
@@ -243,34 +244,6 @@ conf_clear(struct conf *c)
}
void
-conf_setup(struct conf *c, const char *conf_file)
-{
- char conf_path[MAXPATHLEN];
- struct stat sb;
- int parse = 0;
-
- conf_init(c);
-
- if (conf_file == NULL) {
- (void)snprintf(conf_path, sizeof(conf_path), "%s/%s",
- homedir, CONFFILE);
-
- if (stat(conf_path, &sb) == 0 && (sb.st_mode & S_IFREG))
- parse = 1;
- } else {
- if (stat(conf_file, &sb) == -1 || !(sb.st_mode & S_IFREG))
- errx(1, "%s: %s", conf_file, strerror(errno));
- else {
- (void)strlcpy(conf_path, conf_file, sizeof(conf_path));
- parse = 1;
- }
- }
-
- if (parse && (parse_config(conf_path, c) == -1))
- warnx("config file %s has errors, not loading", conf_path);
-}
-
-void
conf_client(struct client_ctx *cc)
{
struct winmatch *wm;