This commit is contained in:
Sungjoon Moon 2026-04-12 16:05:04 +01:00 committed by GitHub
commit df17c51605
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,4 @@
#include <fcntl.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
@ -53,6 +54,14 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) {
if (child == 0) {
setsid();
int devnull = open("/dev/null", O_RDWR);
if (devnull > STDERR_FILENO) {
dup2(devnull, STDIN_FILENO);
dup2(devnull, STDOUT_FILENO);
dup2(devnull, STDERR_FILENO);
close(devnull);
}
if (ctx) {
const char *token = launcher_ctx_get_token_name(ctx);
setenv("XDG_ACTIVATION_TOKEN", token, 1);