static int config_exec ( int argc, char **argv ) {
struct config_context dummy_context;
+ int rc;
if ( argc != 1 ) {
printf ( "Usage: %s\n"
}
dummy_context.options = ugly_nvo_hack->options;
- settings_ui ( &dummy_context );
+ if ( ( rc = settings_ui ( &dummy_context ) ) != 0 ) {
+ printf ( "Could not save settings: %s\n",
+ strerror ( rc ) );
+ return 1;
+ }
return 0;
}
}
}
-static void main_loop ( struct config_context *context ) {
+static int main_loop ( struct config_context *context ) {
struct setting_widget widget;
unsigned int current = 0;
unsigned int next;
alert ( " Could not save options: %s ",
strerror ( rc ) );
}
- return;
+ return rc;
default:
edit_setting ( &widget, key );
break;
}
-void settings_ui ( struct config_context *context ) {
+int settings_ui ( struct config_context *context ) {
+ int rc;
+
initscr();
start_color();
init_pair ( CPAIR_NORMAL, COLOR_WHITE, COLOR_BLUE );
color_set ( CPAIR_NORMAL, NULL );
erase();
- main_loop ( context );
+ rc = main_loop ( context );
endwin();
+
+ return rc;
}