X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Flinux-os.c;h=a23bc5ddb306a113a74356164bb616092ea49669;hb=f0cb0cf9c0fe1b6fce5d10dbd34a0b7b249c4ae8;hp=b7ceca179cc24294f9b926ff72e9f791500a4e41;hpb=266ccb364ef5379abd1c0c7b0a2aa81c41753de6;p=sbcl.git diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index b7ceca1..a23bc5d 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -273,7 +273,9 @@ os_init(char *argv[], char *envp[]) * in an error or if the value didn't change. Otherwise * this might result in an infinite loop. */ - if (retval != -1 && newpers != pers) { + + if (!getenv("SBCL_IS_RESTARTING") && + retval != -1 && newpers != pers) { /* Use /proc/self/exe instead of trying to figure out * the executable path from PATH and argv[0], since * that's unreliable. We follow the symlink instead of @@ -282,15 +284,21 @@ os_init(char *argv[], char *envp[]) char runtime[PATH_MAX+1]; int i = readlink("/proc/self/exe", runtime, PATH_MAX); if (i != -1) { + environ = envp; + setenv("SBCL_IS_RESTARTING", "T", 1); runtime[i] = '\0'; - execve(runtime, argv, envp); + execv(runtime, argv); } } /* Either changing the personality or execve() failed. Either * way we might as well continue, and hope that the random * memory maps are ok this time around. */ - fprintf(stderr, "WARNING: Couldn't re-execute SBCL with the proper personality flags (maybe /proc isn't mounted?). Trying to continue anyway.\n"); + fprintf(stderr, "WARNING:\ +\nCouldn't re-execute SBCL with proper personality flags (/proc isn't mounted? setuid?)\ +\nTrying to continue anyway.\n"); + } else { + unsetenv("SBCL_IS_RESTARTING"); } } #ifdef LISP_FEATURE_X86