Hi

On Wed, Sep 2, 2020 at 9:54 AM Lev Stipakov <lstipa...@gmail.com> wrote:

> Hi,
>
> >>                  if (dwResult != ERROR_SUCCESS)
> >>                  {
> >> -                    tap_delete_adapter(NULL, &guidAdapter,
> &bRebootRequired);
> >> +                    /* failed renaming is not a fatal error, continue
> */
> >> +                    dwResult = ERROR_SUCCESS;
> >
> >
> > This looks strange. If we are going to rewrite dwResult, why set it and
> check it at all, just call
> > tap_set_adapter() without storing the return value and add the comment.
>
> I think this is good for documentation purposes - that we are aware
> that function may fail, but in this case it is not fatal and we continue.
>

That's achieved also by just adding a comment that we don't check the
return value as failure is not fatal. Anyway, this works too.


>
> > Or, better, print a warning message saying the rename failed.
>
> Warning is printed inside tap_delete_adapter().
>

tap_delete_adapter() is not called here. I was suggesting that if we do
check the return value, let us also print a  warning that renaming failed.
That can't be  done anywhere except just before converting the error
to SUCCESS.

Selva
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to