summaryrefslogtreecommitdiff
path: root/lcdgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-09-07 06:02:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-09-07 06:02:53 -0400
commit2240d9ca9f1b367ef985eef8a3a028936ac71f56 (patch)
tree3c9543b96e5eb24b35836942db7c508fc239a8da /lcdgps.c
parentc6e26279e448cb50d26aa308a1473a1d192b192a (diff)
downloadgpsd-2240d9ca9f1b367ef985eef8a3a028936ac71f56.tar.gz
Replace exit({0,1}) with exit(EXIT_{SUCCESS,FAILURE})
Note there are some exit(2) instances we bneed to decide what to do with.
Diffstat (limited to 'lcdgps.c')
-rw-r--r--lcdgps.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lcdgps.c b/lcdgps.c
index 38000392..f90ce122 100644
--- a/lcdgps.c
+++ b/lcdgps.c
@@ -248,7 +248,7 @@ static void usage( char *prog)
" n = Nautical\"\n"
, prog);
- exit(1);
+ exit(EXIT_FAILURE);
}
int main(int argc, char *argv[])
@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
switch (option) {
case 'V':
(void)fprintf(stderr, "lcdgs revision " REVISION "\n");
- exit(0);
+ exit(EXIT_SUCCESS);
case 'h':
default:
usage(argv[0]);
@@ -366,7 +366,7 @@ int main(int argc, char *argv[])
h = gethostbyname(LCDDHOST);
if(h==NULL) {
printf("%s: unknown host '%s'\n",argv[0],LCDDHOST);
- exit(1);
+ exit(EXIT_FAILURE);
}
servAddr.sin_family = h->h_addrtype;
@@ -377,7 +377,7 @@ int main(int argc, char *argv[])
sd = socket(AF_INET, SOCK_STREAM, 0);
if(sd == -1) {
perror("cannot open socket ");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* bind any port number */
@@ -389,14 +389,14 @@ int main(int argc, char *argv[])
if(rc == -1) {
printf("%s: cannot bind port TCP %u\n",argv[0],LCDDPORT);
perror("error ");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* connect to server */
rc = connect(sd, (struct sockaddr *) &servAddr, sizeof(servAddr));
if(rc == -1) {
perror("cannot connect ");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Do the initial field label setup. */