~jamesodhunt/ubuntu/natty/upstart/fix-chroot-sessions

« back to all changes in this revision

Viewing changes to init/conf.c

New upstream release 0.9.6: Important session+chroot fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
517
517
        nih_debug ("Updating configuration for %s from %s",
518
518
                  source->path, override_path);
519
519
        if (conf_reload_path (source, source->path, override_path) < 0) {
520
 
                NihError *err;
 
520
                if (err)
 
521
                        nih_free (err);
521
522
 
522
 
                err = nih_error_get ();
523
 
                nih_error ("%s: %s: %s", override_path,
524
 
                                _("Error while reloading configuration file"),
525
 
                                err->message);
526
 
                nih_free (err);
 
523
                return -1;
527
524
        }
528
525
 
529
526
        return 0;
935
932
 * conf_reload_path:
936
933
 * @source: configuration source,
937
934
 * @path: path of conf file to be reloaded.
938
 
 * @override_path: if TRUE and @path refers to a path associated with @source,
 
935
 * @override_path: if not NULL and @path refers to a path associated with @source,
939
936
 * overlay the contents of @path into the existing @source entry for
940
937
 * @path. If FALSE, discard any existing knowledge of @path.
941
938
 *
946
943
 *
947
944
 * If the file has been parsed before, then the existing item is deleted and
948
945
 * freed if the file fails to load, or after the new item has been parsed.
949
 
 * Items are not reused between reloads.
 
946
 * Items are only reused between reloads if @override_path is
 
947
 * non-NULL.
950
948
 *
951
949
 * Physical errors are returned, parse errors are not.
952
950
 *
968
966
        nih_assert (source != NULL);
969
967
        nih_assert (path != NULL);
970
968
 
971
 
        path_to_load = ( override_path ? override_path : path);
 
969
        path_to_load = (override_path ? override_path : path);
972
970
 
973
971
        /* If there is no corresponding override file, look up the old
974
972
         * conf file in memory, and then free it.  In cases of failure,
975
973
         * we discard it anyway, so there's no particular reason
976
974
         * to keep it around anymore.
 
975
         *
 
976
         * Note: if @override_path has been specified, do not
 
977
         * free the file if found, since we want to _update_ the
 
978
         * existing entry.
977
979
         */
978
980
        file = (ConfFile *)nih_hash_lookup (source->files, path);
979
981
        if (! override_path && file)
987
989
        if (! buf)
988
990
                return -1;
989
991
 
990
 
        /* Create a new ConfFile structure (if no override_path was specified) */
 
992
        /* Create a new ConfFile structure (if no @override_path specified) */
991
993
        file = (ConfFile *)nih_hash_lookup (source->files, path);
992
994
        if (! file)
993
995
                file = NIH_MUST (conf_file_new (source, path));