mirror of
https://github.com/swaywm/sway.git
synced 2024-11-24 00:41:28 +00:00
sway/main: fail if only one of --socket and --wayland-fd are given
This commit is contained in:
parent
934018253c
commit
6532b0eb49
|
@ -1,3 +1,4 @@
|
|||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include <signal.h>
|
||||
|
@ -292,6 +293,14 @@ int main(int argc, char **argv) {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Fail if only one of --socket and --wayland-fd are given.
|
||||
if ((socket_name == NULL) ^ (socket_fd == -1)) {
|
||||
fprintf(stderr,
|
||||
"Both --socket and --wayland-fd are required for Wayland "
|
||||
"socket handover, but only one was provided. Aborting.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// As the 'callback' function for wlr_log is equivalent to that for
|
||||
// sway, we do not need to override it.
|
||||
if (debug) {
|
||||
|
|
Loading…
Reference in a new issue