From 0ba8df5c2d717405c16aea1f476e3e3f7559fb97 Mon Sep 17 00:00:00 2001 From: Patrick Stewart Date: Wed, 13 Apr 2016 21:50:16 +0100 Subject: [PATCH] Change stdin member of svc to stdin_fd 'stdin' is a macro in stdio.h, so it shouldn't be used as a member name. GLIBC happens to have "#define stdin stdin", but other libcs don't. --- inetd.c | 2 +- service.c | 6 +++--- svc.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 inetd.c mode change 100644 => 100755 svc.h diff --git a/inetd.c b/inetd.c old mode 100644 new mode 100755 index 5fc37e3c..59720cbe --- a/inetd.c +++ b/inetd.c @@ -167,7 +167,7 @@ static void socket_cb(uev_t *UNUSED(w), void *arg, int UNUSED(events)) memcpy(task->args, svc->args, sizeof(task->args)); snprintf(task->desc, sizeof(task->desc), "%s Connection", svc->desc); - task->stdin = stdin; + task->stdin_fd = stdin; service_step(task); if (!svc->inetd.forking) { diff --git a/service.c b/service.c index 35cc5af1..e3076b8e 100755 --- a/service.c +++ b/service.c @@ -189,8 +189,8 @@ static int service_start(svc_t *svc) /* Redirect inetd socket to stdin for connection */ #ifndef INETD_DISABLED if (svc_is_inetd_conn(svc)) { - dup2(svc->stdin, STDIN_FILENO); - close(svc->stdin); + dup2(svc->stdin_fd, STDIN_FILENO); + close(svc->stdin_fd); dup2(STDIN_FILENO, STDOUT_FILENO); dup2(STDIN_FILENO, STDERR_FILENO); } else @@ -263,7 +263,7 @@ static int service_start(svc_t *svc) #ifndef INETD_DISABLED if (svc_is_inetd_conn(svc) && svc->inetd.type == SOCK_STREAM) - close(svc->stdin); + close(svc->stdin_fd); #endif plugin_run_hook(HOOK_SVC_START, (void *)(uintptr_t)pid); diff --git a/svc.h b/svc.h old mode 100644 new mode 100755 index 487820fa..dc14404a --- a/svc.h +++ b/svc.h @@ -99,7 +99,7 @@ typedef struct svc { /* For inetd services */ inetd_t inetd; - int stdin; + int stdin_fd; int log;