From nobody Tue Feb 10 03:39:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1568185554; cv=none; d=zoho.com; s=zohoarc; b=O524R6a5c6oLPHYzQQZnj42KKvqxcoI93XPGQo1NVP2LU2j2/pkEY4vgQYGqx4sgUbh40UTa6K8J6TVP61pq46gB+nO0koMN0twAwsLI9tETPr2ZvLzXI+bNcuANuFRsn33xdUq5HiVCHuzbt/48jOJ/HIP6AMflJ8QsesKEjyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568185554; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=AV6Mh1umFYbaDBhT6em+rv3JQUQZHc/z/ZeFSX/VEJk=; b=DJxa2XSie2w+VTTzgWlXxFLYrJ1rvawEIoBy36twU4Q5iyxGhbFVCNSdn7CmeIozkU01l6Zi6ncqDXqUl7VatrIiji5TXIrxYD/lqpFdqDxRoPU/9As+1lUKcTSaqu2oAI2WGtdto+qIXXofpvmG7fm1YVVS129GC2l1Hs/xe74= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568185554388602.7737358480263; Wed, 11 Sep 2019 00:05:54 -0700 (PDT) Received: from localhost ([::1]:47148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7whD-00059v-78 for importer@patchew.org; Wed, 11 Sep 2019 03:05:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40899) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7wRk-00068g-Ad for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7wRj-0004Qj-8g for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:44 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:58021) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i7wRj-0004Py-0H for qemu-devel@nongnu.org; Wed, 11 Sep 2019 02:49:43 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mzhzd-1iLKWS2rw1-00vbu6; Wed, 11 Sep 2019 08:49:25 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Wed, 11 Sep 2019 08:49:06 +0200 Message-Id: <20190911064920.1718-2-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190911064920.1718-1-laurent@vivier.eu> References: <20190911064920.1718-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:XRNaDVW/Z6FFauGWDmfsEwdbmHLOp9czIYg/b7ZfJNy9qHKSfGE H29vtQwz34phoQeBvDFaul7IhkYM7kkgeblbhRyuVReX6iH2xZ0HQbw6cNuQAmyNWe/5v9h OM+/n4WMocQe/9ZzRR1wVkMA2ZYxKhwMYPs//Eu+fxr8fnwqbEpH1nunhTqRVJ+HjaqObim Kiy5vJZZvdnyG+1Fc2NRg== X-UI-Out-Filterresults: notjunk:1;V03:K0:g+4deSDCMqQ=:5LDGnoSHT9zYaHZq4eChyl wkBSEG1Lm965AykirnABv66GwVBtdb3be0NMI80huF3vxDRXl+YgcYjL2zYeuyGmP2buUFjyg E++sGDaBdgxa0HUW0Bp7Ju+iXXJM3sXM3SYJ+1JthrI32ZJ16q9q4vZvvQbtdpRDF8J8iy10V /txQccNthfJWCX0ZkJQAfXCw31es6yCNuVM1BQ3NEQ2KfY3RG9kyWQUG+QD0DwRF8wL6kZqEx vIqr1ZLkcYh8Wx41QoyA7l+wLjOVjxrARUUfEUXjYdO+PA3swHavAeIWOzi7uG+nqP7bqFvgX o1dQqTysDZzEJ45/CgBaYBhORKNYPQFaRfcwXDsqHRK+U8JSkVpMYWVJhoqMmKATPyHiSs6ov IV4+oxiQyJfht6sznBDER3qbhGsZI+g/d8gZekuJNgBB1p5C2aKtQjmjlYlKbwPjH6cmiFfI/ Q1W2gs9nDRybBGek2RTrID+241hYXC3JFFSZOhAbuBybDxfDVek2ZV+iYSv+BjDBeRDETXDzh dqIcJr0x56rz3lgsCg3cCDDIxUiNBcWJu7ZKxIpch00cio61JPjlqk9MnUQ9MdC6GHt4dhGbx 2PWk8c+UNCeX2/2qoamLvKIWWO0lpzTC2I03bujsu6i6C+5x46XJxqFty2tbxFL0X4gQ4NCSF UTkngEnueaR/ipcBBjqpvYcmXlFUgqe0b0eM+EpRF1A0KZhE1Kp9EMsUBHaQXFwRUTrpCq4G/ VxkuZJmn0FoH1gAn7pLBwMPleEr1gFZzeIk0w+zT2KM9PAGydc7KxzbzA+sKIzXbwxLYsx7ls mg9TTswo+e/RjTV3sN2GxCOO9m/JR09NOng4Zpe5Nw7JSW4DHY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL v2 01/15] linux-user: remove useless variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Riku Voipio , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" filename is only used to open the file if AT_EXECFD is not provided. But exec_path already contains the path of the file to open. Remove filename as it is only used in main.c whereas exec_path is also used in syscall.c. Fixes: d088d664f201 ("linux-user: identify running binary in /proc/self/exe= ") Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella Message-Id: <20190714134028.315-1-laurent@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 47917bbb20fc..28f0065b6ddf 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -49,7 +49,6 @@ char *exec_path; =20 int singlestep; -static const char *filename; static const char *argv0; static int gdbstub_port; static envlist_t *envlist; @@ -586,7 +585,6 @@ static int parse_args(int argc, char **argv) exit(EXIT_FAILURE); } =20 - filename =3D argv[optind]; exec_path =3D argv[optind]; =20 return optind; @@ -657,9 +655,9 @@ int main(int argc, char **argv, char **envp) =20 execfd =3D qemu_getauxval(AT_EXECFD); if (execfd =3D=3D 0) { - execfd =3D open(filename, O_RDONLY); + execfd =3D open(exec_path, O_RDONLY); if (execfd < 0) { - printf("Error while loading %s: %s\n", filename, strerror(errn= o)); + printf("Error while loading %s: %s\n", exec_path, strerror(err= no)); _exit(EXIT_FAILURE); } } @@ -784,10 +782,10 @@ int main(int argc, char **argv, char **envp) cpu->opaque =3D ts; task_settid(ts); =20 - ret =3D loader_exec(execfd, filename, target_argv, target_environ, reg= s, + ret =3D loader_exec(execfd, exec_path, target_argv, target_environ, re= gs, info, &bprm); if (ret !=3D 0) { - printf("Error while loading %s: %s\n", filename, strerror(-ret)); + printf("Error while loading %s: %s\n", exec_path, strerror(-ret)); _exit(EXIT_FAILURE); } =20 --=20 2.21.0