main: do not exit in case stdin is a closed stream

Weston should not exit if stdin is a closed stream. This allows
to launch with a closed stdin:

  # weston <&-

This fixes screen sharing using weston: Weston closes the stdin
before forking itself to execute the screen sharing instance of
weston. Before this patch screen sharing failed with:
  Screen share failed: No wl_shm found
  unknown child process exited

Fixes: f0d39b2243 ("weston: Set CLOEXEC on stdin")
Signed-off-by: Stefan Agner <stefan@agner.ch>
dev
Stefan Agner 6 years ago committed by Daniel Stone
parent 1cbe1f952d
commit 3b1c1efe34
  1. 5
      compositor/main.c

@ -2548,10 +2548,7 @@ int main(int argc, char *argv[])
wl_list_init(&wet.layoutput_list); wl_list_init(&wet.layoutput_list);
if (os_fd_set_cloexec(fileno(stdin))) { os_fd_set_cloexec(fileno(stdin));
printf("Unable to set stdin as close on exec().\n");
return EXIT_FAILURE;
}
cmdline = copy_command_line(argc, argv); cmdline = copy_command_line(argc, argv);
parse_options(core_options, ARRAY_LENGTH(core_options), &argc, argv); parse_options(core_options, ARRAY_LENGTH(core_options), &argc, argv);

Loading…
Cancel
Save