argv might be null when we're init
This commit is contained in:
parent
4f6333ca17
commit
796d61020b
@ -59,8 +59,7 @@ extern "C" void initialize_libc(int, char** argv)
|
|||||||
check_for_file(STDOUT_FILENO, &stdout, "/dev/console", "rw");
|
check_for_file(STDOUT_FILENO, &stdout, "/dev/console", "rw");
|
||||||
check_for_file(STDERR_FILENO, &stderr, "/dev/console", "rw");
|
check_for_file(STDERR_FILENO, &stderr, "/dev/console", "rw");
|
||||||
|
|
||||||
program_invocation_name =
|
if (argv) program_invocation_name = argv[0];
|
||||||
argv[0]; // argv[0] should only be nullptr when being init, which shouldn't use program_invocation_name anyways.
|
|
||||||
|
|
||||||
initialize_random();
|
initialize_random();
|
||||||
atexit(terminate_libc);
|
atexit(terminate_libc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user