mirror of
https://github.com/tio/tio.git
synced 2026-05-01 23:07:58 +02:00
Cleanup global variable name shadowing
This commit is contained in:
parent
5c45150f58
commit
d60363a64c
1 changed files with 11 additions and 11 deletions
22
src/socket.c
22
src/socket.c
|
|
@ -52,23 +52,23 @@ static const char *socket_filename(void)
|
||||||
static int socket_inet_port(void)
|
static int socket_inet_port(void)
|
||||||
{
|
{
|
||||||
/* skip 'inet:' */
|
/* skip 'inet:' */
|
||||||
int port_number = atoi(option.socket + 5);
|
int port = atoi(option.socket + 5);
|
||||||
if (port_number == 0)
|
if (port == 0)
|
||||||
{
|
{
|
||||||
port_number = SOCKET_PORT_DEFAULT;
|
port = SOCKET_PORT_DEFAULT;
|
||||||
}
|
}
|
||||||
return port_number;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int socket_inet6_port(void)
|
static int socket_inet6_port(void)
|
||||||
{
|
{
|
||||||
/* skip 'inet6:' */
|
/* skip 'inet6:' */
|
||||||
int port_number = atoi(option.socket + 6);
|
int port = atoi(option.socket + 6);
|
||||||
if (port_number == 0)
|
if (port == 0)
|
||||||
{
|
{
|
||||||
port_number = SOCKET_PORT_DEFAULT;
|
port = SOCKET_PORT_DEFAULT;
|
||||||
}
|
}
|
||||||
return port_number;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void socket_exit(void)
|
static void socket_exit(void)
|
||||||
|
|
@ -83,14 +83,14 @@ static bool socket_stale(const char *path)
|
||||||
{
|
{
|
||||||
struct sockaddr_un addr;
|
struct sockaddr_un addr;
|
||||||
bool stale = false;
|
bool stale = false;
|
||||||
int sockfd;
|
int sfd;
|
||||||
|
|
||||||
/* Test if socket file exists */
|
/* Test if socket file exists */
|
||||||
if (access(path, F_OK) == 0)
|
if (access(path, F_OK) == 0)
|
||||||
{
|
{
|
||||||
/* Create test socket */
|
/* Create test socket */
|
||||||
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
|
sfd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||||
if (sockfd < 0)
|
if (sfd < 0)
|
||||||
{
|
{
|
||||||
tio_warning_printf("Failure opening socket (%s)", strerror(errno));
|
tio_warning_printf("Failure opening socket (%s)", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue