[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Netcfg--Add-WPA-support 3/3] Add WPA support



Glenn Saberton <gsaberton@foomagic.org> writes:

> +static int start_wpa_daemon(struct debconfclient *client)
> +{
> +    wpa_supplicant_pid = fork();
> +
> +    if (wpa_supplicant_pid == 0) {
> +        fclose(client->out);
> +        if (execlp("wpa_supplicant", "wpa_supplicant", "-i", interface, "-C",
> +                   WPASUPP_CTRL, "-P", WPAPID, "-B", NULL) == -1) {
> +            di_error("could not exec wpasupplicant: %s", strerror(errno));
> +            return 1;
> +        }
> +        else 
> +            return 0;
> +    }
> +    else {
> +        waitpid(wpa_supplicant_pid, NULL, 0);
> +        return 0;
> +    }
> +}

this looks fishy. Are you sure you want to return if the child has
failed to exec?

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4


Reply to: