[PATCH 4/6] added openconnect_strdup()

David Woodhouse dwmw2 at infradead.org
Fri Sep 26 03:44:46 PDT 2014


On Tue, 2014-09-16 at 14:12 +0200, Nikos Mavrogiannopoulos wrote:
> On Mon, Sep 15, 2014 at 2:25 PM, David Woodhouse <dwmw2 at infradead.org> wrote:
> > On Tue, 2014-08-26 at 16:00 +0200, Nikos Mavrogiannopoulos wrote:
> >> +             ret = -GetLastError();
> > Hm, that makes us return a value that isn't in the normal errno space,
> > doesn't it?
> > Admittedly, I don't think anyone ever actually *does* anything with the
> > return value from script_config_tun(), but still I think we should use
> > FormatMessage() to print the error correctly, and then return something
> > like -EIO rather than a Windows error code.
> 
> I thought it didn't make much sense to bother as there was no check of
> this function's error code, but strictly speaking you're right.
> 
> >> -     if (ret == 0x2331) {
> >> -             /* This is what cmd.exe returns for unrecognised commands */
> > That made some sense...
> >
> >>       if (ret) {
> >> +             /* This is what cmd.exe returns for unrecognised commands */
> > ... but this doesn't. For a start we're not using cmd.exe any more...
> > and you seem to be suggesting that *all* values other than -1 mean that
> > it was an unrecognised command :)
> 
> Indeed. Do you want an updated patch?

Please. If canyou can manage the FormatMessage thing too (we have other
potential users for it especially in tun-win32.c) that would be much
appreciated. I'm now working on tidying up the rest of the stuff in my
'api4.0' branch to get it pushed to master.

-- 
dwmw2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openconnect-devel/attachments/20140926/78407a4f/attachment-0001.bin>


More information about the openconnect-devel mailing list