path: root/ui/ncurses/nc-config.c
diff options
authorJeremy Kerr <>2014-01-28 13:01:19 +0800
committerJeremy Kerr <>2014-01-30 21:59:10 +0800
commitdea7842fb28ff055b4e0f43a6a1fdaf3c4b5ba89 (patch)
tree4c17ee2b9250d04d028d0bf1ad996e91861f049a /ui/ncurses/nc-config.c
parentd239d484e3d34da52024f6e97e7046774d7b299d (diff)
lib/pb-config: Add config_copy
At the moment, UIs have the config_set_defaults function to estabilish an initial configuration when performing an update. Rather than using the defaults, this change provides a config_copy() function, so that the updated configuration can be initialised from the current config. With this in place, the UI/server-common pb-config module can be reduced to just the one function. Signed-off-by: Jeremy Kerr <>
Diffstat (limited to 'ui/ncurses/nc-config.c')
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 6b29a66..74105f1 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -150,13 +150,13 @@ struct nc_scr *config_screen_scr(struct config_screen *screen)
static int screen_process_form(struct config_screen *screen)
const struct system_info *sysinfo = screen->cui->sysinfo;
- struct config *config = talloc_zero(screen, struct config);
enum net_conf_type net_conf_type;
struct interface_config *iface;
+ struct config *config;
char *str, *end;
int rc;
- config_set_defaults(config);
+ config = config_copy(screen, screen->cui->config);
config->autoboot_enabled =
@@ -212,6 +212,7 @@ static int screen_process_form(struct config_screen *screen)
screen->scr.frame.status =
"No IP / mask values are set";
+ talloc_free(config);
return -1;
OpenPOWER on IntegriCloud