diff options
-rw-r--r-- | src/routines.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/routines.c b/src/routines.c index 696bedb..8ccf386 100644 --- a/src/routines.c +++ b/src/routines.c @@ -47,24 +47,24 @@ int copy_outside(char *password) if(pid == 0) /* new process */ exit(run_clipboard(password)); return 0; - #endif + #else + if(getenv("WAYLAND_DISPLAY") != NULL) { + char * const wl_copy[] = {"wl-copy", password, NULL}; + int pid; + pid = fork(); + if(pid == -1) + errprint_r(1, "Wayland fork() failed\n"); + if(pid == 0) { /* new process */ + execvp("wl-copy", wl_copy); + perror("wl-copy"); + exit(1); + } - if(getenv("WAYLAND_DISPLAY") != NULL) { - char * const wl_copy[] = {"wl-copy", password, NULL}; - int pid; - pid = fork(); - if(pid == -1) - errprint_r(1, "Wayland fork() failed\n"); - if(pid == 0) { /* new process */ - execvp("wl-copy", wl_copy); - perror("wl-copy"); - exit(1); + return 0; } - return 0; - } - - errprint_r(1, "You didn't have x11 or wayland when app builded\n"); + errprint_r(1, "You didn't have x11 or wayland when app builded\n"); + #endif } int check_sneaky_paths(const char *path) |