summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-04-14 03:03:19 +0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-04-13 20:17:24 -0700
commit63ba277c694104b3f01d0a1adee7903631607694 (patch)
treee29c1a6e9b44e74222857b7037ee33308523d80f
parenta63c31f74e1c11509b561ab9687138f5c960df0f (diff)
Use EXIT_{SUCCESS, FAILURE} from C90 instead of homegrown equivalents
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xinit.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/xinit.c b/xinit.c
index deb7aa4..222c8b5 100644
--- a/xinit.c
+++ b/xinit.c
@@ -104,8 +104,6 @@ char xserverrcbuf[256];
#define TRUE 1
#define FALSE 0
-#define OK_EXIT 0
-#define ERR_EXIT 1
static char *default_server = "X";
static char *default_display = ":0"; /* choose most efficient */
@@ -351,14 +349,14 @@ main(int argc, char *argv[])
if (gotSignal != 0) {
Error("unexpected signal %d.\n", gotSignal);
- exit(ERR_EXIT);
+ exit(EXIT_FAILURE);
}
if (serverpid < 0)
Fatal("Server error.\n");
if (clientpid < 0)
Fatal("Client error.\n");
- exit(OK_EXIT);
+ exit(EXIT_SUCCESS);
}
@@ -490,7 +488,7 @@ startServer(char *server[])
}
fprintf(stderr, "\n");
}
- exit(ERR_EXIT);
+ exit(EXIT_FAILURE);
break;
case -1:
@@ -633,7 +631,7 @@ startClient(char *client[])
if (setuid(getuid()) == -1) {
Error("cannot change uid: %s\n", strerror(errno));
- _exit(ERR_EXIT);
+ _exit(EXIT_FAILURE);
}
setpgid(0, getpid());
Execute(client);
@@ -643,7 +641,7 @@ startClient(char *client[])
fprintf(stderr,
"is in your path.\r\n");
fprintf(stderr, "\n");
- _exit(ERR_EXIT);
+ _exit(EXIT_FAILURE);
} else {
return clientpid;
}
@@ -718,7 +716,7 @@ set_environment(void)
{
if (setenv("DISPLAY", displayNum, TRUE) == -1) {
fprintf(stderr, "%s: unable to set DISPLAY\n", program);
- exit(ERR_EXIT);
+ exit(EXIT_FAILURE);
}
}
@@ -726,7 +724,7 @@ static void
Fatal(char *msg)
{
Error(msg);
- exit(ERR_EXIT);
+ exit(EXIT_FAILURE);
}
static void