texit() return values changed from 1 and 0 to EXIT_FAILURE and EXIT_SUCCESS. - … | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit c3bb05619f430cd3bf666e30bdf3890fe8ceeb20 | |
parent 91774be5855ad25176ccae832819694066e0dca4 | |
Author: Ben Webb <[email protected]> | |
Date: Fri, 19 Jul 2002 10:56:45 +0000 | |
exit() return values changed from 1 and 0 to EXIT_FAILURE and EXIT_SUCCESS. | |
Diffstat: | |
M src/AIPlayer.c | 2 +- | |
M src/admin.c | 4 ++-- | |
M src/curses_client/curses_client.c | 4 ++-- | |
M src/gtkport/gtkport.c | 4 ++-- | |
M src/network.c | 6 +++--- | |
M src/serverside.c | 12 ++++++------ | |
M win32/makeinstall.c | 5 +++-- | |
7 files changed, 19 insertions(+), 18 deletions(-) | |
--- | |
diff --git a/src/AIPlayer.c b/src/AIPlayer.c | |
t@@ -182,7 +182,7 @@ void AIPlayerLoop() | |
if (errno == EINTR) | |
continue; | |
printf("Error in select\n"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
datawaiting = | |
diff --git a/src/admin.c b/src/admin.c | |
t@@ -53,7 +53,7 @@ static int OpenSocket(void) | |
sock = socket(PF_UNIX, SOCK_STREAM, 0); | |
if (sock == -1) { | |
perror("socket"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
addr.sun_family = AF_UNIX; | |
t@@ -63,7 +63,7 @@ static int OpenSocket(void) | |
if (connect(sock, (struct sockaddr *)&addr, | |
sizeof(struct sockaddr_un)) == -1) { | |
perror("connect"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
g_print(_("Connection established; use Ctrl-D to " | |
diff --git a/src/curses_client/curses_client.c b/src/curses_client/curses_clien… | |
t@@ -326,7 +326,7 @@ static gboolean SelectServerFromMetaServer(Player *Play, G… | |
continue; | |
} | |
perror("bselect"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
if (FD_ISSET(0, &readfds)) { | |
/* So that Ctrl-L works */ | |
t@@ -538,7 +538,7 @@ static gboolean DoConnect(Player *Play, GString *errstr) | |
continue; | |
} | |
perror("bselect"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
if (FD_ISSET(0, &readfds)) { | |
/* So that Ctrl-L works */ | |
diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c | |
t@@ -5321,9 +5321,9 @@ static gboolean gtk_url_triggered(GtkWidget *widget, Gdk… | |
if (pid == 0) { | |
execv(bin, args); | |
g_print("dopewars: cannot execute %s\n", bin); | |
- _exit(1); | |
+ _exit(EXIT_FAILURE); | |
} else { | |
- _exit(0); | |
+ _exit(EXIT_SUCCESS); | |
} | |
} | |
} | |
diff --git a/src/network.c b/src/network.c | |
t@@ -104,7 +104,7 @@ void StartNetworking() | |
errstr->str); | |
g_string_free(errstr, TRUE); | |
FreeError(error); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
} | |
t@@ -120,7 +120,7 @@ void SetReuse(SOCKET sock) | |
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&i, | |
sizeof(i)) == -1) { | |
perror("setsockopt"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
} | |
t@@ -148,7 +148,7 @@ void SetReuse(int sock) | |
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)) == -1) { | |
perror("setsockopt"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
} | |
diff --git a/src/serverside.c b/src/serverside.c | |
t@@ -851,7 +851,7 @@ static gboolean StartServer(void) | |
errstr->str); | |
g_string_free(errstr, TRUE); | |
FreeError(sockerr); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
/* This doesn't seem to work properly under Win32 */ | |
t@@ -868,13 +868,13 @@ static gboolean StartServer(void) | |
_("Cannot bind to port %u (%s) Aborting."), Port, errstr->str); | |
g_string_free(errstr, TRUE); | |
FreeError(sockerr); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
if (listen(ListenSock, 10) == SOCKET_ERROR) { | |
g_log(NULL, G_LOG_LEVEL_CRITICAL, | |
_("Cannot listen to network socket. Aborting.")); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
/* Initial startup message for the server */ | |
t@@ -1041,7 +1041,7 @@ Player *HandleNewConnection(void) | |
if ((ClientSock = accept(ListenSock, (struct sockaddr *)&ClientAddr, | |
&cadsize)) == -1) { | |
perror("accept socket"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
dopelog(2, LF_SERVER, _("got connection from %s"), | |
inet_ntoa(ClientAddr.sin_addr)); | |
t@@ -1823,13 +1823,13 @@ void DropPrivileges() | |
setregid(getgid(), getgid()); | |
if (getgid() != getegid()) { | |
perror("setregid"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
setreuid(getuid(), getuid()); | |
if (getuid() != geteuid()) { | |
perror("setreuid"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
#endif | |
} | |
diff --git a/win32/makeinstall.c b/win32/makeinstall.c | |
t@@ -22,6 +22,7 @@ | |
#include <windows.h> | |
#include <stdio.h> | |
+#include <stdlib.h> | |
#include "zlib/zlib.h" | |
#include "util.h" | |
t@@ -110,7 +111,7 @@ InstData *ReadInstallData() | |
switch (section) { | |
case S_NONE: | |
printf("Bad line %s\n", line); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
case S_PRODUCT: | |
printf("product ID = %s\n", line); | |
idata->product = line; | |
t@@ -160,7 +161,7 @@ InstData *ReadInstallData() | |
return idata; | |
} else { | |
printf("No directories specified\n"); | |
- exit(1); | |
+ exit(EXIT_FAILURE); | |
} | |
} | |