Add legacy shwitch for -sbox-call
authorRiku Voipio <riku.voipio@nokia.com>
Wed, 14 Jan 2009 16:05:27 +0000 (18:05 +0200)
committerRiku Voipio <riku.voipio@nokia.com>
Wed, 14 Jan 2009 16:07:24 +0000 (18:07 +0200)
From: Toni Timonen

The --sbox-call means that the name of the binary and every argument,
including argv[0], is given in command line. In some cases this can't
really be resolved from the actual binary called, so it is being
preserved. This is used from -misc-runner.

Toni:

"If I remember correctly, the first argument after --sbox-call (that is
the actual binary name) is used to locate the actual binary that is
being called, but rest of the arguments are given to the elf (eg. we
skipped the program name, but kept the argv[0]; in scratchbox these
two can be different in quite many cases)."

linux-user/main.c

index bdc1d9d..3418ca6 100644 (file)
@@ -2310,6 +2310,9 @@ int main(int argc, char **argv, char **envp)
         } else if (!strcmp(r, "0")) {
             r = argv[optind++];
             argv0 = r;
+        } else if (!strcmp(r,"-sbox-call")) {
+           r = argv[optind++];
+           argv0 = r;
         } else if (!strcmp(r, "s")) {
             r = argv[optind++];
             x86_stack_size = strtol(r, (char **)&r, 0);