diff options
author | Rob Norris <rw_norris@hotmail.com> | 2016-02-19 17:42:53 +0000 |
---|---|---|
committer | Jon Schlueter <jschlueter@redhat.com> | 2016-02-19 18:59:05 -0500 |
commit | 3fbde4ea81104a5ceaf5147f581f4df634ab54a0 (patch) | |
tree | 645460bf670000f79dbed58cbd6cffeb15dd3548 /test_libgps.c | |
parent | 53e5261906a59f21551d34e7b2ab14eb93abd28a (diff) | |
download | gpsd-3fbde4ea81104a5ceaf5147f581f4df634ab54a0.tar.gz |
Fix test_libgps program as it always reports "Daemon is not running" for a successful gps_open() call.
gps_open() returns 0 on success or a negative number on failure.
Thus the right test is either '!= 0' (or just '< 0') rather than '<= 0'.
The operator '!=' is preferred since that is how the other programs cgps, gpspipe, etc... use gps_open()
Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
Diffstat (limited to 'test_libgps.c')
-rw-r--r-- | test_libgps.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test_libgps.c b/test_libgps.c index e0958745..36342acb 100644 --- a/test_libgps.c +++ b/test_libgps.c @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) } } #endif - } else if (gps_open(NULL, 0, &collect) <= 0) { + } else if (gps_open(NULL, 0, &collect) != 0) { (void)fputs("Daemon is not running.\n", stdout); exit(EXIT_FAILURE); } else if (optind < argc) { |