search for: config_lookup_bool

Displaying 2 results from an estimated 2 matches for "config_lookup_bool".

2014 Feb 17
2
[PATCH 1/2] fish: small refactor of config reading code
...ut settings into our - * variables between calls. - * - * (2) If the next call fails then 'read_only' variable is not - * updated. Failure could happen just because the setting is - * missing from the configuration file, so we ignore it here. - */ - config_lookup_bool (&conf, "read_only", &read_only); - } - } + config_init (&conf); - fp = fopen (etc_filename, "r"); - if (fp != NULL) { /* if (verbose) fprintf (stderr, "%s: reading configuration from %s\n", - program_name, etc_file...
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...IG @@ -68,10 +69,8 @@ read_config_from_file (const char *filename) exit (EXIT_FAILURE); } - if (fclose (fp) == -1) { - perror (filename); - exit (EXIT_FAILURE); - } + if (fclose (fp) == -1) + error (EXIT_FAILURE, errno, "fclose: %s", filename); config_lookup_bool (&conf, "read_only", &read_only); @@ -101,10 +100,8 @@ parse_config (void) CLEANUP_FREE char *path = NULL; const char *dir = xdg_config_dirs[i - 1]; - if (asprintf (&path, "%s/libguestfs/" GLOBAL_CONFIG_FILENAME, dir) == -1) { - perror (...