Browse Source

get_interfaces() now does a return 0 instead of an exit 1

if no network interfaces are present.  Callers have been
modified to BACKUP in this case, but this will change.

r17189
tags/0.71
Thomas Hood 17 years ago
parent
commit
0eb734b4e0
4 changed files with 19 additions and 7 deletions
  1. +7
    -7
      netcfg-common.c
  2. +4
    -0
      netcfg-dhcp.c
  3. +4
    -0
      netcfg-static.c
  4. +4
    -0
      netcfg.c

+ 7
- 7
netcfg-common.c View File

@@ -363,7 +363,13 @@ int netcfg_get_interface(struct debconfclient *client, char **interface,
debconf_input(client, "high", "netcfg/no_interfaces");
debconf_go(client);
free(ptr);
exit(1);
*numif = 0;
return 0;
}
else if (num_interfaces == 1)
{
inter = ptr;
*numif = 1;
}
else if (num_interfaces > 1)
{
@@ -388,11 +394,6 @@ int netcfg_get_interface(struct debconfclient *client, char **interface,
if (!inter)
netcfg_die(client);
}
else if (num_interfaces == 1)
{
inter = ptr;
*numif = 1;
}

/* grab just the interface name, not the description too */
*interface = inter;
@@ -400,7 +401,6 @@ int netcfg_get_interface(struct debconfclient *client, char **interface,
if (ptr == NULL)
goto error;
*ptr = '\0';

*interface = strdup(*interface);

/* Free allocated memory */


+ 4
- 0
netcfg-dhcp.c View File

@@ -55,6 +55,10 @@ int main(int argc, char *argv[])
case GET_INTERFACE:
if (netcfg_get_interface(client, &interface, &num_interfaces))
state = BACKUP;
else if (! interface || ! num_interfaces)
{
state = BACKUP;
}
else
{
if (is_wireless_iface(interface))


+ 4
- 0
netcfg-static.c View File

@@ -53,6 +53,10 @@ int main(int argc, char** argv)
case GET_INTERFACE:
if (netcfg_get_interface(client, &interface, &num_interfaces))
state = BACKUP;
else if (! interface || ! num_interfaces)
{
state = BACKUP;
}
else
{
if (is_wireless_iface(interface))


+ 4
- 0
netcfg.c View File

@@ -92,6 +92,10 @@ int main(int argc, char *argv[])
case GET_INTERFACE:
if(netcfg_get_interface(client, &interface, &num_interfaces))
state = BACKUP;
else if (! interface || ! num_interfaces)
{
state = BACKUP;
}
else
{
if (is_wireless_iface (interface))


Loading…
Cancel
Save