mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
main: Increase FD limit
This defaults to 1024, which is tiny, but is a requirement for processes using the deprecated `select` function. We must reset this back whenever we fork to start a new process, as this is inherited, and breaks applications using `select` otherwise. Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
parent
6c2bbb42ea
commit
722aa042b7
2 changed files with 6 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include <unistd.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "common/spawn.h"
|
||||
#include "common/fd_util.h"
|
||||
|
||||
void
|
||||
spawn_async_no_shell(char const *command)
|
||||
|
|
@ -39,6 +40,8 @@ spawn_async_no_shell(char const *command)
|
|||
wlr_log(WLR_ERROR, "unable to fork()");
|
||||
goto out;
|
||||
case 0:
|
||||
restore_nofile_limit();
|
||||
|
||||
setsid();
|
||||
sigset_t set;
|
||||
sigemptyset(&set);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "theme.h"
|
||||
#include "xbm/xbm.h"
|
||||
#include "menu/menu.h"
|
||||
#include "common/fd_util.h"
|
||||
|
||||
struct rcxml rc = { 0 };
|
||||
|
||||
|
|
@ -85,6 +86,8 @@ main(int argc, char *argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
increase_nofile_limit();
|
||||
|
||||
struct server server = { 0 };
|
||||
server_init(&server);
|
||||
server_start(&server);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue