mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
posix: Remove ununsed posix_spawn internal assignment
The internal 'ret' variable in '__spawni_child' function is not used after assignment in most cases. Checked on x86_64-linux-gnu. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Remove ununsed assignment.
This commit is contained in:
parent
daeb1fa2e1
commit
249548e476
2 changed files with 19 additions and 16 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2017-04-24 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Remove ununsed
|
||||||
|
assignment.
|
||||||
|
|
||||||
2017-04-24 Daurnimator <quae@daurnimator.com>
|
2017-04-24 Daurnimator <quae@daurnimator.com>
|
||||||
Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,6 @@ __spawni_child (void *arguments)
|
||||||
struct posix_spawn_args *args = arguments;
|
struct posix_spawn_args *args = arguments;
|
||||||
const posix_spawnattr_t *restrict attr = args->attr;
|
const posix_spawnattr_t *restrict attr = args->attr;
|
||||||
const posix_spawn_file_actions_t *file_actions = args->fa;
|
const posix_spawn_file_actions_t *file_actions = args->fa;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* The child must ensure that no signal handler are enabled because it shared
|
/* The child must ensure that no signal handler are enabled because it shared
|
||||||
memory with parent, so the signal disposition must be either SIG_DFL or
|
memory with parent, so the signal disposition must be either SIG_DFL or
|
||||||
|
@ -167,12 +166,12 @@ __spawni_child (void *arguments)
|
||||||
if ((attr->__flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER))
|
if ((attr->__flags & (POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER))
|
||||||
== POSIX_SPAWN_SETSCHEDPARAM)
|
== POSIX_SPAWN_SETSCHEDPARAM)
|
||||||
{
|
{
|
||||||
if ((ret = __sched_setparam (0, &attr->__sp)) == -1)
|
if (__sched_setparam (0, &attr->__sp) == -1)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
else if ((attr->__flags & POSIX_SPAWN_SETSCHEDULER) != 0)
|
else if ((attr->__flags & POSIX_SPAWN_SETSCHEDULER) != 0)
|
||||||
{
|
{
|
||||||
if ((ret = __sched_setscheduler (0, attr->__policy, &attr->__sp)) == -1)
|
if (__sched_setscheduler (0, attr->__policy, &attr->__sp) == -1)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -183,13 +182,13 @@ __spawni_child (void *arguments)
|
||||||
|
|
||||||
/* Set the process group ID. */
|
/* Set the process group ID. */
|
||||||
if ((attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
|
if ((attr->__flags & POSIX_SPAWN_SETPGROUP) != 0
|
||||||
&& (ret = __setpgid (0, attr->__pgrp)) != 0)
|
&& __setpgid (0, attr->__pgrp) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
/* Set the effective user and group IDs. */
|
/* Set the effective user and group IDs. */
|
||||||
if ((attr->__flags & POSIX_SPAWN_RESETIDS) != 0
|
if ((attr->__flags & POSIX_SPAWN_RESETIDS) != 0
|
||||||
&& ((ret = local_seteuid (__getuid ())) != 0
|
&& (local_seteuid (__getuid ()) != 0
|
||||||
|| (ret = local_setegid (__getgid ())) != 0))
|
|| local_setegid (__getgid ()) != 0))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
/* Execute the file actions. */
|
/* Execute the file actions. */
|
||||||
|
@ -206,8 +205,7 @@ __spawni_child (void *arguments)
|
||||||
switch (action->tag)
|
switch (action->tag)
|
||||||
{
|
{
|
||||||
case spawn_do_close:
|
case spawn_do_close:
|
||||||
if ((ret =
|
if (close_not_cancel (action->action.close_action.fd) != 0)
|
||||||
close_not_cancel (action->action.close_action.fd)) != 0)
|
|
||||||
{
|
{
|
||||||
if (!have_fdlimit)
|
if (!have_fdlimit)
|
||||||
{
|
{
|
||||||
|
@ -232,10 +230,10 @@ __spawni_child (void *arguments)
|
||||||
paths (like /dev/watchdog). */
|
paths (like /dev/watchdog). */
|
||||||
close_not_cancel (action->action.open_action.fd);
|
close_not_cancel (action->action.open_action.fd);
|
||||||
|
|
||||||
ret = open_not_cancel (action->action.open_action.path,
|
int ret = open_not_cancel (action->action.open_action.path,
|
||||||
action->action.
|
action->action.
|
||||||
open_action.oflag | O_LARGEFILE,
|
open_action.oflag | O_LARGEFILE,
|
||||||
action->action.open_action.mode);
|
action->action.open_action.mode);
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -245,19 +243,19 @@ __spawni_child (void *arguments)
|
||||||
/* Make sure the desired file descriptor is used. */
|
/* Make sure the desired file descriptor is used. */
|
||||||
if (ret != action->action.open_action.fd)
|
if (ret != action->action.open_action.fd)
|
||||||
{
|
{
|
||||||
if ((ret = __dup2 (new_fd, action->action.open_action.fd))
|
if (__dup2 (new_fd, action->action.open_action.fd)
|
||||||
!= action->action.open_action.fd)
|
!= action->action.open_action.fd)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if ((ret = close_not_cancel (new_fd)) != 0)
|
if (close_not_cancel (new_fd) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case spawn_do_dup2:
|
case spawn_do_dup2:
|
||||||
if ((ret = __dup2 (action->action.dup2_action.fd,
|
if (__dup2 (action->action.dup2_action.fd,
|
||||||
action->action.dup2_action.newfd))
|
action->action.dup2_action.newfd)
|
||||||
!= action->action.dup2_action.newfd)
|
!= action->action.dup2_action.newfd)
|
||||||
goto fail;
|
goto fail;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue