mirror of
https://github.com/troglobit/finit.git
synced 2026-11-09 16:21:24 +00:00
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.
This commit is contained in:
1 parent
ec2505191b
commit
0ba8df5c2d
3 files changed
+5
-5
No files matched your search
@@ -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));
|
memcpy(task->args, svc->args, sizeof(task->args));
|
||||||
snprintf(task->desc, sizeof(task->desc), "%s Connection", svc->desc);
|
snprintf(task->desc, sizeof(task->desc), "%s Connection", svc->desc);
|
||||||
|
|
||||||
task->stdin = stdin;
|
task->stdin_fd = stdin;
|
||||||
service_step(task);
|
service_step(task);
|
||||||
|
|
||||||
if (!svc->inetd.forking) {
|
if (!svc->inetd.forking) {
|
||||||
|
|||||||
@@ -189,8 +189,8 @@ static int service_start(svc_t *svc)
|
|||||||
/* Redirect inetd socket to stdin for connection */
|
/* Redirect inetd socket to stdin for connection */
|
||||||
#ifndef INETD_DISABLED
|
#ifndef INETD_DISABLED
|
||||||
if (svc_is_inetd_conn(svc)) {
|
if (svc_is_inetd_conn(svc)) {
|
||||||
dup2(svc->stdin, STDIN_FILENO);
|
dup2(svc->stdin_fd, STDIN_FILENO);
|
||||||
close(svc->stdin);
|
close(svc->stdin_fd);
|
||||||
dup2(STDIN_FILENO, STDOUT_FILENO);
|
dup2(STDIN_FILENO, STDOUT_FILENO);
|
||||||
dup2(STDIN_FILENO, STDERR_FILENO);
|
dup2(STDIN_FILENO, STDERR_FILENO);
|
||||||
} else
|
} else
|
||||||
@@ -263,7 +263,7 @@ static int service_start(svc_t *svc)
|
|||||||
|
|
||||||
#ifndef INETD_DISABLED
|
#ifndef INETD_DISABLED
|
||||||
if (svc_is_inetd_conn(svc) && svc->inetd.type == SOCK_STREAM)
|
if (svc_is_inetd_conn(svc) && svc->inetd.type == SOCK_STREAM)
|
||||||
close(svc->stdin);
|
close(svc->stdin_fd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
plugin_run_hook(HOOK_SVC_START, (void *)(uintptr_t)pid);
|
plugin_run_hook(HOOK_SVC_START, (void *)(uintptr_t)pid);
|
||||||
|
|||||||
Reference in new issue
Block a user