kopia lustrzana https://github.com/Hamlib/Hamlib
Fix cppcheck warnings in rotctld.c
rodzic
ab63348217
commit
f0437aa575
|
@ -166,7 +166,6 @@ int main(int argc, char *argv[])
|
|||
struct addrinfo hints, *result, *saved_result;
|
||||
int sock_listen;
|
||||
int reuseaddr = 1;
|
||||
int sockopt;
|
||||
char host[NI_MAXHOST];
|
||||
char serv[NI_MAXSERV];
|
||||
|
||||
|
@ -175,9 +174,6 @@ int main(int argc, char *argv[])
|
|||
pthread_attr_t attr;
|
||||
#endif
|
||||
struct handle_data *arg;
|
||||
#if HAVE_SIGACTION
|
||||
struct sigaction act;
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
@ -416,12 +412,16 @@ int main(int argc, char *argv[])
|
|||
exit(1);
|
||||
}
|
||||
|
||||
sockopt = SO_SYNCHRONOUS_NONALERT;
|
||||
setsockopt(INVALID_SOCKET,
|
||||
SOL_SOCKET,
|
||||
SO_OPENTYPE,
|
||||
(char *)&sockopt,
|
||||
sizeof(sockopt));
|
||||
{
|
||||
// braced to prevent cppcheck warning
|
||||
int sockopt = SO_SYNCHRONOUS_NONALERT;
|
||||
setsockopt(INVALID_SOCKET,
|
||||
SOL_SOCKET,
|
||||
SO_OPENTYPE,
|
||||
(char *)&sockopt,
|
||||
sizeof(sockopt));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -471,7 +471,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
/* allow IPv4 mapped to IPv6 clients, MS & BSD default this
|
||||
to 1 i.e. disallowed */
|
||||
sockopt = 0;
|
||||
int sockopt = 0;
|
||||
|
||||
if (setsockopt(sock_listen,
|
||||
IPPROTO_IPV6,
|
||||
|
@ -522,13 +522,16 @@ int main(int argc, char *argv[])
|
|||
that will consequently fail with EPIPE. All child threads will
|
||||
inherit this disposition which is what we want. */
|
||||
#if HAVE_SIGACTION
|
||||
memset(&act, 0, sizeof act);
|
||||
act.sa_handler = SIG_IGN;
|
||||
act.sa_flags = SA_RESTART;
|
||||
|
||||
if (sigaction(SIGPIPE, &act, NULL))
|
||||
{
|
||||
handle_error(RIG_DEBUG_ERR, "sigaction");
|
||||
struct sigaction act;
|
||||
memset(&act, 0, sizeof act);
|
||||
act.sa_handler = SIG_IGN;
|
||||
act.sa_flags = SA_RESTART;
|
||||
|
||||
if (sigaction(SIGPIPE, &act, NULL))
|
||||
{
|
||||
handle_error(RIG_DEBUG_ERR, "sigaction");
|
||||
}
|
||||
}
|
||||
|
||||
#elif HAVE_SIGNAL
|
||||
|
|
Ładowanie…
Reference in New Issue