From nobody Fri May 3 19:36:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513678421036852.3609750390624; Tue, 19 Dec 2017 02:13:41 -0800 (PST) Received: from localhost ([::1]:35313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eREtg-0003DQ-GL for importer@patchew.org; Tue, 19 Dec 2017 05:13:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eREsm-0002m3-4m for qemu-devel@nongnu.org; Tue, 19 Dec 2017 05:12:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eREsg-0008Fd-2J for qemu-devel@nongnu.org; Tue, 19 Dec 2017 05:12:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28905) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eREsf-0008En-QI for qemu-devel@nongnu.org; Tue, 19 Dec 2017 05:12:13 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E1D95FD51; Tue, 19 Dec 2017 10:12:11 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.35.7.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEA361853C; Tue, 19 Dec 2017 10:12:06 +0000 (UTC) From: Yoni Bettan To: qemu-devel@nongnu.org Date: Tue, 19 Dec 2017 12:11:22 +0200 Message-Id: <20171219101122.31711-1-ybettan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Dec 2017 10:12:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH V3] vl.c && linux-user/main.c : removed **envp from main() arguments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Yoni Bettan , Riku Voipio , Laurent Vivier , Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" it was added on 2008 902b3d5c39 when introduced cache-utils.[ch] since then cache-utils.[ch] were removed but **envp was left behind. By the way "to be portable it is best to write main to take two arguments, and use the value of environ" according to https://www.gnu.org/software/libc/manual/html_node/Program-\ Arguments.html#Program-Arguments Signed-off-by: Yoni Bettan --- V2 -> V3: =20 since ui/cocoa.c rename main() is using qemu_main() ,because it uses it=20 inside its main() function, the function qemu_main() can't be removed =20 V1 -> V2: removed the ui/cocoa.c renaming of main() function since i thought that= we=20 no longer need qemu_main() include/qemu-common.h | 2 +- linux-user/main.c | 2 +- ui/cocoa.m | 5 ++--- vl.c | 7 +++---- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/qemu-common.h b/include/qemu-common.h index 05319b9ddc..8a5b7ec5ec 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -29,7 +29,7 @@ =20 /* main function, renamed */ #if defined(CONFIG_COCOA) -int qemu_main(int argc, char **argv, char **envp); +int qemu_main(int argc, char **argv); #endif =20 void qemu_get_timedate(struct tm *tm, int offset); diff --git a/linux-user/main.c b/linux-user/main.c index 6286661bd3..fe81d410da 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4237,7 +4237,7 @@ static int parse_args(int argc, char **argv) return optind; } =20 -int main(int argc, char **argv, char **envp) +int main(int argc, char **argv) { struct target_pt_regs regs1, *regs =3D ®s1; struct image_info info1, *info =3D &info1; diff --git a/ui/cocoa.m b/ui/cocoa.m index 330ccebf90..4d18153659 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -25,7 +25,6 @@ #include "qemu/osdep.h" =20 #import -#include =20 #include "qemu-common.h" #include "ui/console.h" @@ -1050,7 +1049,7 @@ QemuCocoaView *cocoaView; COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n"); =20 int status; - status =3D qemu_main(argc, argv, *_NSGetEnviron()); + status =3D qemu_main(argc, argv); exit(status); } =20 @@ -1391,7 +1390,7 @@ int main (int argc, const char * argv[]) { !strcmp(opt, "-curses") || !strcmp(opt, "-display") || !strcmp(opt, "-qtest")) { - return qemu_main(gArgc, gArgv, *_NSGetEnviron()); + return qemu_main(gArgc, gArgv); } } } diff --git a/vl.c b/vl.c index fc8bd9372f..ea17cc34f6 100644 --- a/vl.c +++ b/vl.c @@ -35,10 +35,10 @@ #ifdef CONFIG_SDL #if defined(__APPLE__) || defined(main) #include -int qemu_main(int argc, char **argv, char **envp); +int qemu_main(int argc, char **argv); int main(int argc, char **argv) { - return qemu_main(argc, argv, NULL); + return qemu_main(argc, argv); } #undef main #define main qemu_main @@ -50,7 +50,6 @@ int main(int argc, char **argv) #define main qemu_main #endif /* CONFIG_COCOA */ =20 - #include "qemu/error-report.h" #include "qemu/sockets.h" #include "hw/hw.h" @@ -3044,7 +3043,7 @@ static void register_global_properties(MachineState *= ms) user_register_global_props(); } =20 -int main(int argc, char **argv, char **envp) +int main(int argc, char **argv) { int i; int snapshot, linux_boot; --=20 2.14.3