diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-10-17 17:20:01 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-10-17 17:20:01 +0000 |
commit | a4c3bb6153b6fd1a8d54abde6f7d9ecd593a4e4d (patch) | |
tree | 75dde2edb2807cb44b6ea17cd2f405ad66399716 /src/common/socket.c | |
parent | 8982c119eaaa031bbdd70798a077c14b5bc183c1 (diff) | |
download | hercules-a4c3bb6153b6fd1a8d54abde6f7d9ecd593a4e4d.tar.gz hercules-a4c3bb6153b6fd1a8d54abde6f7d9ecd593a4e4d.tar.bz2 hercules-a4c3bb6153b6fd1a8d54abde6f7d9ecd593a4e4d.tar.xz hercules-a4c3bb6153b6fd1a8d54abde6f7d9ecd593a4e4d.zip |
Using predefined constants as parameters to the exit() function.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11501 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/socket.c')
-rw-r--r-- | src/common/socket.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/socket.c b/src/common/socket.c index c70c0cbaa..6b52dd402 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -297,7 +297,7 @@ int make_listen_bind(uint32 ip, uint16 port) if (fd == INVALID_SOCKET) { ShowError("socket() creation failed (code %d)!\n", s_errno); - exit(1); + exit(EXIT_FAILURE); } if ( fd >= FD_SETSIZE ) { //Not enough capacity for this socket @@ -316,17 +316,17 @@ int make_listen_bind(uint32 ip, uint16 port) result = bind(fd, (struct sockaddr*)&server_address, sizeof(server_address)); if( result == SOCKET_ERROR ) { ShowError("bind failed (socket %d, code %d)!\n", fd, s_errno); - exit(1); + exit(EXIT_FAILURE); } result = listen( fd, 5 ); if( result == SOCKET_ERROR ) { ShowError("listen failed (socket %d, code %d)!\n", fd, s_errno); - exit(1); + exit(EXIT_FAILURE); } if ( fd < 0 || fd > FD_SETSIZE ) { //Crazy error that can happen in Windows? (info from Freya) ShowFatalError("listen() returned invalid fd %d!\n",fd); - exit(1); + exit(EXIT_FAILURE); } if(fd_max <= fd) fd_max = fd + 1; @@ -469,7 +469,7 @@ int RFIFOSKIP(int fd, size_t len) if ( s->rdata_size < s->rdata_pos + len ) { //fprintf(stderr,"too many skip\n"); - //exit(1); + //exit(EXIT_FAILURE); //better than a COMPLETE program abort // TEST! :) ShowError("too many skip (%d) now skipped: %d (FD: %d)\n", len, RFIFOREST(fd), fd); len = RFIFOREST(fd); @@ -494,7 +494,7 @@ int WFIFOSET(int fd, size_t len) fd, CONVIP(ip), len, s->wdata_size, s->max_wdata); ShowDebug("Likely command that caused it: 0x%x\n", (*(unsigned short*)(s->wdata + s->wdata_size))); // no other chance, make a better fifo model - exit(1); + exit(EXIT_FAILURE); } s->wdata_size += len; |