Replaced exit codes with values that aren't taken by errno
This commit is contained in:
@@ -26,7 +26,7 @@ int create_socket(int network, char transport);
|
|||||||
port is self-explanatory;
|
port is self-explanatory;
|
||||||
and dest is a pointer to the sockaddr struct that will be filled in.
|
and dest is a pointer to the sockaddr struct that will be filled in.
|
||||||
|
|
||||||
The function exits with error code 2 if the network parameter contained neither '4'
|
The function exits with error code 202 if the network parameter contained neither '4'
|
||||||
nor '6'. */
|
nor '6'. */
|
||||||
|
|
||||||
void create_addr(int network, char* address, int port,struct sockaddr* dest);
|
void create_addr(int network, char* address, int port,struct sockaddr* dest);
|
||||||
@@ -37,7 +37,7 @@ void create_addr(int network, char* address, int port,struct sockaddr* dest);
|
|||||||
_binds_ the addresses. It is used for local sockets (server sockets). Parameters are
|
_binds_ the addresses. It is used for local sockets (server sockets). Parameters are
|
||||||
same as above.
|
same as above.
|
||||||
|
|
||||||
It prints the error returned by 'bind' if something went wrong, and exits with error code '3'.*/
|
It prints the error returned by 'bind' if something went wrong, and exits with errno.*/
|
||||||
|
|
||||||
int create_local (int network, char transport, char* address, int port,struct sockaddr* addr_struct);
|
int create_local (int network, char transport, char* address, int port,struct sockaddr* addr_struct);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ int create_local (int network, char transport, char* address, int port,struct so
|
|||||||
requested address. It is used for remote sockets (client sockets). The paramters are same
|
requested address. It is used for remote sockets (client sockets). The paramters are same
|
||||||
as above. This function needs an empty 'sockaddr *' structure passed to it, which it will fill.
|
as above. This function needs an empty 'sockaddr *' structure passed to it, which it will fill.
|
||||||
|
|
||||||
It prints the error returned by 'connect' if something went wrong, and exits with error code '3'.*/
|
It prints the error returned by 'connect' if something went wrong, and exits with errno.*/
|
||||||
|
|
||||||
int create_remote (int network,char transport,char* address,int port,struct sockaddr* remote_addr_struct);
|
int create_remote (int network,char transport,char* address,int port,struct sockaddr* remote_addr_struct);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user