summaryrefslogtreecommitdiff
path: root/test_libgps.c
diff options
context:
space:
mode:
authorRob Norris <rw_norris@hotmail.com>2016-02-19 17:42:53 +0000
committerJon Schlueter <jschlueter@redhat.com>2016-02-19 18:59:05 -0500
commit3fbde4ea81104a5ceaf5147f581f4df634ab54a0 (patch)
tree645460bf670000f79dbed58cbd6cffeb15dd3548 /test_libgps.c
parent53e5261906a59f21551d34e7b2ab14eb93abd28a (diff)
downloadgpsd-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.c2
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) {