[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] [PATCH v2 1/1] gps2udp: reset errno after getaddrinfo cal
From: |
Mike Frysinger |
Subject: |
Re: [gpsd-dev] [PATCH v2 1/1] gps2udp: reset errno after getaddrinfo call |
Date: |
Fri, 3 Jan 2014 08:08:36 -0500 |
User-agent: |
KMail/1.13.7 (Linux/3.12.1; KDE/4.6.5; x86_64; ; ) |
On Friday 03 January 2014 05:10:57 Ferry Huberts wrote:
> It returns errno==2 ("No such file or directory") when the program
> is run as "LD_LIBRARY_PATH=. ./gps2udp -n -u 224.0.0.224:2240"
> in the source directory.
>
> The observed effect was that the port number conversion considered
> a perfectly valid port number as invalid.
blindly checking errno alone is wrong, so whatever code is doing that should
be fixed instead. the logic should always be "if this func returned an error,
then we look at errno to see what the error was".
> +#include "errno.h"
system headers should use <...> not "..."
> + errno=0;
there needs to be spaces around that =
-mike
signature.asc
Description: This is a digitally signed message part.