diff options
author | 2017-03-13 07:35:12 -0400 | |
---|---|---|
committer | 2017-03-13 07:35:12 -0400 | |
commit | b507462d1c66e11cce76e069a508621dc9599f07 (patch) | |
tree | 52cc52fb0ec42085c37bee5f4f2e5c5f10cf2631 /swaylock/main.c | |
parent | deprecate new_window and new_float commands (diff) | |
parent | Merge pull request #1113 from johnchen902/patch-1 (diff) | |
download | sway-b507462d1c66e11cce76e069a508621dc9599f07.tar.gz sway-b507462d1c66e11cce76e069a508621dc9599f07.tar.zst sway-b507462d1c66e11cce76e069a508621dc9599f07.zip |
Merge branch 'master' of git://github.com/SirCmpwn/sway into new-command-aliases
Diffstat (limited to 'swaylock/main.c')
-rw-r--r-- | swaylock/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 49b24a3a..9b33aab9 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #define _XOPEN_SOURCE 500 | ||
1 | #include "wayland-swaylock-client-protocol.h" | 2 | #include "wayland-swaylock-client-protocol.h" |
2 | #include <xkbcommon/xkbcommon.h> | 3 | #include <xkbcommon/xkbcommon.h> |
3 | #include <xkbcommon/xkbcommon-names.h> | 4 | #include <xkbcommon/xkbcommon-names.h> |
@@ -460,12 +461,16 @@ int main(int argc, char **argv) { | |||
460 | case 'u': | 461 | case 'u': |
461 | show_indicator = false; | 462 | show_indicator = false; |
462 | break; | 463 | break; |
463 | case 'f': | 464 | case 'f': { |
464 | if (daemon(0, 0) != 0) { | 465 | pid_t t = fork(); |
466 | if (t == -1) { | ||
465 | sway_log(L_ERROR, "daemon call failed"); | 467 | sway_log(L_ERROR, "daemon call failed"); |
466 | exit(EXIT_FAILURE); | 468 | exit(EXIT_FAILURE); |
469 | } else if (t > 0) { | ||
470 | exit(0); | ||
467 | } | 471 | } |
468 | break; | 472 | break; |
473 | } | ||
469 | case 'r': | 474 | case 'r': |
470 | if (line_source != LINE_SOURCE_DEFAULT) { | 475 | if (line_source != LINE_SOURCE_DEFAULT) { |
471 | sway_log(L_ERROR, "line source options conflict"); | 476 | sway_log(L_ERROR, "line source options conflict"); |