diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-26 23:49:31 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-26 23:49:31 +0000 |
commit | b9cc68ba066757a71565fd29dd0e886a17bf2e21 (patch) | |
tree | 01d6463c81093c428f57f90d60d8f05791a6917d /cgps.c | |
parent | f57255209c5b25c74e1fd5c84b6636bf76f02298 (diff) | |
download | gpsd-b9cc68ba066757a71565fd29dd0e886a17bf2e21.tar.gz |
Add gps_errstr() to the client API so client code doesn't have to
reinvent it all the time. Use it in gpsmon.
Diffstat (limited to 'cgps.c')
-rw-r--r-- | cgps.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -754,18 +754,9 @@ int main(int argc, char *argv[]) /* Open the stream to gpsd. */ /*@i@*/gpsdata = gps_open(source.server, source.port); if (!gpsdata) { - switch ( errno ) { - case NL_NOSERVICE: err_str = "can't get service entry"; break; - case NL_NOHOST: err_str = "can't get host entry"; break; - case NL_NOPROTO: err_str = "can't get protocol entry"; break; - case NL_NOSOCK: err_str = "can't create socket"; break; - case NL_NOSOCKOPT: err_str = "error SETSOCKOPT SO_REUSEADDR"; break; - case NL_NOCONNECT: err_str = "can't connect to host"; break; - default: err_str = "Unknown"; break; - } (void)fprintf( stderr, "cgps: no gpsd running or network error: %d, %s\n", - errno, err_str); + errno, netlib_errstr(errno)); exit(2); } |