From patchwork Mon Apr 24 12:47:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 98041 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1465243qgf; Mon, 24 Apr 2017 05:47:33 -0700 (PDT) X-Received: by 10.99.124.71 with SMTP id l7mr24380301pgn.14.1493038053896; Mon, 24 Apr 2017 05:47:33 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a5si1288323pgd.190.2017.04.24.05.47.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Apr 2017 05:47:33 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-78883-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-78883-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-78883-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=FAtFxpUb0wytK2Y5trbDXg62iUb+lff O8SgJvFTgVRQX2pROFrDPZls4erFQYNmySWxf0seJFnpYWJ9Q+/CxulwtG1U2cWg zbdl27fSfRESN0/wTMBGpOjZSRWmwmTt6eYuN/mw1sESgbjgQxm9BOuABdLHtZ7D ZE+mcgp5r1UI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=bsodV79pceVT9kjZJeBfAYY1edY=; b=HPe/M 0D43JhVmwEuSZHJpyCsQadkjtkDupptsb3rwBDMwQpfn101Meop+ruQcZJ3VSgav an9QEGqk6kXJILyCnN8lKxEvcwlGdEYvJiYz3Oywp1LhxU/kw0UC3/UOaufiI4DE 7dAQ8rEJGAHsikzB6HAgvhnTGQ1Sr6xJW/WKbs= Received: (qmail 56020 invoked by alias); 24 Apr 2017 12:47:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 55993 invoked by uid 89); 24 Apr 2017 12:47:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=disposition X-HELO: mail-qk0-f182.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Z0btVo5EPRyrAz6lQffOXUDfzBTgVJOD/dR0g67GutA=; b=sOBGemJdPKDdSo9tMMxXlVu8/m5j7IVHHX8f4r2c415yiWYRLDV9nQ+902XV9Stp4g SU8uPQWVyZcQZgKjKxOZBN6nhbOdbKztT7GZIV/bhe2+caj67lDh9cBZTmgsPoV+tHqB xeISyazwpdhCnVCaDYUpio6LPMNZPNZvAkBw3KoYGcCrIVzQNrYWa2W4ZN4bH9eK+cu9 GGMrdlvu9msw7SLj0vMbo7Kgwt7Hg2VH+qq9LKYm0mt9Aus0H5S5i82Gk0NhhEfOJc4q 1/r3WMJykN4LrzpphhLvKE+om7GRxRuNudAJpinfO4oVbyZbtkcaP8NmZvOumOcJX4IU dqIw== X-Gm-Message-State: AN3rC/7yXxlp30q0cwTL++cHWTkTr6iFGushgDObVSH6PnA/DpsYcQmS kzKbbROkeQlnV5m1tUB5LQ== X-Received: by 10.233.232.210 with SMTP id a201mr5061323qkg.238.1493038030823; Mon, 24 Apr 2017 05:47:10 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/2] posix: Remove ununsed posix_spawn internal assignment Date: Mon, 24 Apr 2017 09:47:01 -0300 Message-Id: <1493038021-16091-2-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1493038021-16091-1-git-send-email-adhemerval.zanella@linaro.org> References: <1493038021-16091-1-git-send-email-adhemerval.zanella@linaro.org> 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. --- ChangeLog | 5 +++++ sysdeps/unix/sysv/linux/spawni.c | 30 ++++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c index fc5d170..f93fbe1 100644 --- a/sysdeps/unix/sysv/linux/spawni.c +++ b/sysdeps/unix/sysv/linux/spawni.c @@ -124,7 +124,6 @@ __spawni_child (void *arguments) struct posix_spawn_args *args = arguments; const posix_spawnattr_t *restrict attr = args->attr; 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 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)) == POSIX_SPAWN_SETSCHEDPARAM) { - if ((ret = __sched_setparam (0, &attr->__sp)) == -1) + if (__sched_setparam (0, &attr->__sp) == -1) goto fail; } 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; } #endif @@ -183,13 +182,13 @@ __spawni_child (void *arguments) /* Set the process group ID. */ if ((attr->__flags & POSIX_SPAWN_SETPGROUP) != 0 - && (ret = __setpgid (0, attr->__pgrp)) != 0) + && (__setpgid (0, attr->__pgrp) != 0)) goto fail; /* Set the effective user and group IDs. */ if ((attr->__flags & POSIX_SPAWN_RESETIDS) != 0 - && ((ret = local_seteuid (__getuid ())) != 0 - || (ret = local_setegid (__getgid ())) != 0)) + && ((local_seteuid (__getuid ()) != 0) + || (local_setegid (__getgid ()) != 0))) goto fail; /* Execute the file actions. */ @@ -206,8 +205,7 @@ __spawni_child (void *arguments) switch (action->tag) { case spawn_do_close: - if ((ret = - close_not_cancel (action->action.close_action.fd)) != 0) + if (close_not_cancel (action->action.close_action.fd) != 0) { if (!have_fdlimit) { @@ -232,10 +230,10 @@ __spawni_child (void *arguments) paths (like /dev/watchdog). */ close_not_cancel (action->action.open_action.fd); - ret = open_not_cancel (action->action.open_action.path, - action->action. - open_action.oflag | O_LARGEFILE, - action->action.open_action.mode); + int ret = open_not_cancel (action->action.open_action.path, + action->action. + open_action.oflag | O_LARGEFILE, + action->action.open_action.mode); if (ret == -1) goto fail; @@ -245,19 +243,19 @@ __spawni_child (void *arguments) /* Make sure the desired file descriptor is used. */ 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) goto fail; - if ((ret = close_not_cancel (new_fd)) != 0) + if (close_not_cancel (new_fd) != 0) goto fail; } } break; case spawn_do_dup2: - if ((ret = __dup2 (action->action.dup2_action.fd, - action->action.dup2_action.newfd)) + if (__dup2 (action->action.dup2_action.fd, + action->action.dup2_action.newfd) != action->action.dup2_action.newfd) goto fail; break;