Do not use the non-standard clearenv() (#69)

The clearenv() is not POSIX-standard, and doesn't exist on *BSD.
Directly manipulate the 'environ' instead.
This commit is contained in:
Aaron LI 2018-10-05 23:04:58 +08:00 committed by Cylgom
parent e2ed1e654b
commit 0476fa64b8
1 changed files with 3 additions and 1 deletions

View File

@ -268,6 +268,8 @@ enum err login_desktop(struct desktop* desktop,
char tty_id [3];
char vt[5];
extern char **environ;
display_id = get_free_display();
snprintf(display_name, sizeof(display_name), ":%d", display_id);
snprintf(tty_id, sizeof(tty_id), "%d", config.tty);
@ -361,7 +363,7 @@ enum err login_desktop(struct desktop* desktop,
tb_shutdown();
// initialization
clearenv();
environ[0] = NULL;
init_xdg(tty_id, display_name, display_server);
// downgrades group permissions