aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config/output.c')
-rw-r--r--sway/config/output.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index 3316085a..3c1822d8 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -825,7 +825,9 @@ static bool _spawn_swaybg(char **command) {
825 setenv("WAYLAND_SOCKET", wayland_socket_str, true); 825 setenv("WAYLAND_SOCKET", wayland_socket_str, true);
826 826
827 execvp(command[0], command); 827 execvp(command[0], command);
828 sway_log_errno(SWAY_ERROR, "execvp failed"); 828 sway_log_errno(SWAY_ERROR, "failed to execute '%s' "
829 "(background configuration probably not applied)",
830 command[0]);
829 _exit(EXIT_FAILURE); 831 _exit(EXIT_FAILURE);
830 } 832 }
831 _exit(EXIT_SUCCESS); 833 _exit(EXIT_SUCCESS);
@@ -835,12 +837,13 @@ static bool _spawn_swaybg(char **command) {
835 sway_log_errno(SWAY_ERROR, "close failed"); 837 sway_log_errno(SWAY_ERROR, "close failed");
836 return false; 838 return false;
837 } 839 }
838 if (waitpid(pid, NULL, 0) < 0) { 840 int fork_status = 0;
841 if (waitpid(pid, &fork_status, 0) < 0) {
839 sway_log_errno(SWAY_ERROR, "waitpid failed"); 842 sway_log_errno(SWAY_ERROR, "waitpid failed");
840 return false; 843 return false;
841 } 844 }
842 845
843 return true; 846 return WIFEXITED(fork_status) && WEXITSTATUS(fork_status) == EXIT_SUCCESS;
844} 847}
845 848
846bool spawn_swaybg(void) { 849bool spawn_swaybg(void) {