GW_NOINTR_CALL removed.

Used in just one place inside MaxScale so better to simply write
it explcitly.
This commit is contained in:
Johan Wikman
2016-10-17 10:41:25 +03:00
parent b27774e674
commit e6d7ca4ed9
2 changed files with 13 additions and 10 deletions

View File

@ -38,8 +38,6 @@
MXS_BEGIN_DECLS MXS_BEGIN_DECLS
#define GW_NOINTR_CALL(A) do { errno = 0; A; } while (errno == EINTR)
bool gw_daemonize(void); bool gw_daemonize(void);
MXS_END_DECLS MXS_END_DECLS

View File

@ -416,25 +416,30 @@ sigfatal_handler(int i)
*/ */
static int signal_set(int sig, void (*handler)(int)) static int signal_set(int sig, void (*handler)(int))
{ {
static struct sigaction sigact;
static int err;
int rc = 0; int rc = 0;
memset(&sigact, 0, sizeof(struct sigaction)); struct sigaction sigact = {};
sigact.sa_handler = handler; sigact.sa_handler = handler;
GW_NOINTR_CALL(err = sigaction(sig, &sigact, NULL));
int err;
do
{
errno = 0;
err = sigaction(sig, &sigact, NULL);
}
while (errno == EINTR);
if (err < 0) if (err < 0)
{ {
int eno = errno;
errno = 0;
char errbuf[MXS_STRERROR_BUFLEN]; char errbuf[MXS_STRERROR_BUFLEN];
MXS_ERROR("Failed call sigaction() in %s due to %d, %s.", MXS_ERROR("Failed call sigaction() in %s due to %d, %s.",
program_invocation_short_name, program_invocation_short_name,
eno, errno,
strerror_r(eno, errbuf, sizeof(errbuf))); strerror_r(errno, errbuf, sizeof(errbuf)));
rc = 1; rc = 1;
} }
return rc; return rc;
} }