mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-06 18:00:28 +00:00
Fix chdir("/")
This commit is contained in:
parent
9157711b6e
commit
b4ec087389
1 changed files with 2 additions and 2 deletions
|
@ -38,6 +38,7 @@ static char *self;
|
||||||
static bool loaded, skiptests, skiparg0;
|
static bool loaded, skiptests, skiparg0;
|
||||||
|
|
||||||
void SetUpOnce(void) {
|
void SetUpOnce(void) {
|
||||||
|
self = GetProgramExecutableName();
|
||||||
testlib_enable_tmp_setup_teardown();
|
testlib_enable_tmp_setup_teardown();
|
||||||
if (IsMetal()) {
|
if (IsMetal()) {
|
||||||
skiptests = true;
|
skiptests = true;
|
||||||
|
@ -70,7 +71,6 @@ void SetUpOnce(void) {
|
||||||
|
|
||||||
__attribute__((__constructor__)) static void Child(int argc, char *argv[]) {
|
__attribute__((__constructor__)) static void Child(int argc, char *argv[]) {
|
||||||
loaded = !!__program_executable_name;
|
loaded = !!__program_executable_name;
|
||||||
self = GetProgramExecutableName();
|
|
||||||
if (argc >= 2 && !strcmp(argv[1], "Child")) {
|
if (argc >= 2 && !strcmp(argv[1], "Child")) {
|
||||||
int rc;
|
int rc;
|
||||||
if (!IsWindows()) {
|
if (!IsWindows()) {
|
||||||
|
@ -81,7 +81,7 @@ __attribute__((__constructor__)) static void Child(int argc, char *argv[]) {
|
||||||
if (rc) {
|
if (rc) {
|
||||||
exit(122);
|
exit(122);
|
||||||
}
|
}
|
||||||
if (strcmp(argv[2], self)) {
|
if (strcmp(argv[2], GetProgramExecutableName())) {
|
||||||
exit(123);
|
exit(123);
|
||||||
}
|
}
|
||||||
if (argc >= 4) {
|
if (argc >= 4) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue