Browse Source

Code cleanup.

r6941
master
Thiemo Seufer 19 years ago
parent
commit
e127e06e98
  1. 7
      debian/changelog
  2. 4
      netcfg-common.c
  3. 11
      netcfg-dhcp.c
  4. 12
      netcfg-static.c
  5. 9
      netcfg.c

7
debian/changelog

@ -1,3 +1,10 @@
netcfg (0.37) UNRELEASED; urgency=low
* Thiemo Seufer
- Code cleanup.
-- Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> Mon, 22 Dec 2003 23:38:05 +0100
netcfg (0.36) unstable; urgency=low
* Bartosz Fenski

4
netcfg-common.c

@ -758,11 +758,10 @@ int netcfg_get_static(struct debconfclient *client)
debconf_metaget(client, "netcfg/internal-none", "description");
none = client->value ? strdup(client->value) : strdup("<none>");
while (state != QUIT) {
while (1) {
switch (state) {
case BACKUP:
return 10; // Back to main
break;
case GET_IPADDRESS:
if (netcfg_get_ipaddress (client)) {
state = BACKUP;
@ -839,7 +838,6 @@ int netcfg_get_static(struct debconfclient *client)
break;
case QUIT:
return 0;
break;
}
}
return 0;

11
netcfg-dhcp.c

@ -50,12 +50,10 @@ int main(void)
client = debconfclient_new();
debconf_capb(client,"backup");
while (state != QUIT) {
while (1) {
switch(state) {
case BACKUP:
exit(10);
break;
return 10;
case GET_INTERFACE:
state = netcfg_get_interface(client, &interface, &num_interfaces) ?
BACKUP : GET_DHCP;
@ -67,12 +65,11 @@ int main(void)
state = QUIT;
break;
case QUIT:
if (netcfg_activate_dhcp(client) != 0)
return 1;
break;
}
}
if (netcfg_activate_dhcp(client) != 0)
exit(1);
return 0;
}

12
netcfg-static.c

@ -46,12 +46,10 @@ int main(void)
client = debconfclient_new();
debconf_capb(client, "backup");
while (state != QUIT) {
while (1) {
switch(state) {
case BACKUP:
exit(10);
break;
return 10;
case GET_INTERFACE:
state = netcfg_get_interface(client, &interface, &num_interfaces) ?
BACKUP : GET_STATIC;
@ -63,13 +61,11 @@ int main(void)
state = QUIT;
break;
case QUIT:
if (netcfg_activate_static(client) != 0)
return 1;
break;
}
}
if (netcfg_activate_static(client) != 0)
exit(1);
return 0;
}

9
netcfg.c

@ -61,8 +61,6 @@ int main(void)
static struct debconfclient *client;
static char *none;
/* initialize libd-i */
di_system_init("netcfg");
@ -73,12 +71,10 @@ int main(void)
debconf_metaget(client, "netcfg/internal-none", "description");
none = client->value ? strdup(client->value) : strdup("<none>");
while (state != QUIT) {
while (1) {
switch(state) {
case BACKUP:
exit(10);
break;
return 10;
case GET_INTERFACE:
state = netcfg_get_interface(client, &interface, &num_interfaces) ?
BACKUP : GET_METHOD;
@ -118,6 +114,5 @@ int main(void)
}
return 0;
}

Loading…
Cancel
Save