//posix_spawn_file_actions_adddup2(&actions, pin[0], STDIN_FILENO);
//posix_spawn_file_actions_adddup2(&actions, pout[1], STDOUT_FILENO);
+ CX_ARRAY(char*, env);
+ cx_array_init(env, 96);
+ for(int i=0;environ[i] != NULL;i++) {
+ cxstring env_str = cx_str(environ[i]);
+ if(!cx_strprefix(env_str, "WAYLAND_DISPLAY")) {
+ //printf("ENV: %s\n", env_str.ptr);
+ cx_array_add(env, env_str.ptr);
+ }
+ }
+ char *n = NULL;
+ cx_array_add(env, n);
+
// start player
pid_t player_pid;
- if(posix_spawn(&player_pid, player_bin, &actions, NULL, args, environ)) {
+ if(posix_spawn(&player_pid, player_bin, &actions, NULL, args, env.data)) {
perror("posix_spawn");
return 1;
}
posix_spawn_file_actions_destroy(&actions);
+ free(env.data);
player->process = player_pid;
player->isactive = TRUE;