X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fcfg.c;h=225827ef5d226936191c600f6b488d8e3182261a;hb=590ab3cc649ca3ecc56e6c5057e7e4e24874a625;hp=433d7a0fac56ba6cb47e402fe573ed909941e8ed;hpb=85c74638ed99b77d6894385c3dce0175c4b4baa4;p=openvswitch diff --git a/lib/cfg.c b/lib/cfg.c index 433d7a0f..225827ef 100644 --- a/lib/cfg.c +++ b/lib/cfg.c @@ -92,6 +92,12 @@ static bool is_type(const char *s, enum cfg_flags); #define CC_FILE_NAME CC_ALNUM "._-" #define CC_KEY CC_ALNUM "._-@$:+" +void +cfg_init(void) +{ + svec_terminate(&cfg); +} + /* Sets 'file_name' as the configuration file read by cfg_read(). Returns 0 on * success, otherwise a positive errno value if 'file_name' cannot be opened. * @@ -183,6 +189,7 @@ cfg_read(void) file = fopen(cfg_name, "r"); if (!file) { VLOG_ERR("failed to open \"%s\": %s", cfg_name, strerror(errno)); + svec_terminate(&cfg); return errno; }