From f5a4228cbd8d9213cc33e1b726b46c8d4c29efec Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 30 Mar 2016 16:11:19 +0200 Subject: [PATCH] fixed two smaller bugs in binfmt_misc based loader --- hermit/tools/proxy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hermit/tools/proxy.c b/hermit/tools/proxy.c index 8275f2d85..7d424eaa6 100644 --- a/hermit/tools/proxy.c +++ b/hermit/tools/proxy.c @@ -42,7 +42,7 @@ #include #define MAX_PATH 255 -#define INADDR(a, b, c, d) (struct in_addr) { .s_addr = ((((((d) << 8) | (c)) << 8) | (b)) << (8)) | a } +#define INADDR(a, b, c, d) (struct in_addr) { .s_addr = ((((((d) << 8) | (c)) << 8) | (b)) << 8) | (a) } #define HERMIT_PORT 0x494E #define HERMIT_IP(isle) INADDR(192, 168, 28, isle + 2) @@ -546,7 +546,12 @@ retry: if (ret < 0) goto out; - // froward program arguments to HermitCore + // forward program arguments to HermitCore + // argv[0] is path of this proxy so we strip it + + argv++; + argc--; + ret = write(s, &argc, sizeof(argc)); if (ret < 0) goto out;