Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalwareutils.git;a=commitdiff;h=0a7133c40872e340bf798282feaa04b9bfa39c5d

commit 0a7133c40872e340bf798282feaa04b9bfa39c5d
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Wed Oct 14 23:27:40 2009 +0200

netconfig: handle errors returned by fwnet_writeconfig()

that's typically the case when the ip or the netmask is not a valid one

diff --git a/netconfig/netconfig.c b/netconfig/netconfig.c
index f92e2be..73e7116 100644
--- a/netconfig/netconfig.c
+++ b/netconfig/netconfig.c
@@ -134,6 +134,7 @@ int dialog_config(int argc, char **argv)
char *ptr;
char *host, *nettype;
char *ipaddr=NULL, *netmask=NULL, *dns=NULL, *iface=NULL;
+       int ret = 0;

dialog_state.output = stderr;
if(argv!=NULL)
@@ -235,7 +236,7 @@ int dialog_config(int argc, char **argv)

if(fwdialog_yesno(_("Adjust configuration files"), _("Accept these settings and 
adjust configuration files?"))
&& !fwutil_dryrun)
-               fwnet_writeconfig(newprofile, host);
+               ret += fwnet_writeconfig(newprofile, host);

g_list_free(newinterface->options);
FWUTIL_FREE(newinterface);
@@ -248,7 +249,7 @@ int dialog_config(int argc, char **argv)
FWUTIL_FREE(dns);
if(argv!=NULL)
end_dialog();
-       return(0);
+       return(ret);
}

int run(int argc, char **argv)
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to