mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -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 <unistd.h>
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include "common/spawn.h"
|
#include "common/spawn.h"
|
||||||
|
#include "common/fd_util.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
spawn_async_no_shell(char const *command)
|
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()");
|
wlr_log(WLR_ERROR, "unable to fork()");
|
||||||
goto out;
|
goto out;
|
||||||
case 0:
|
case 0:
|
||||||
|
restore_nofile_limit();
|
||||||
|
|
||||||
setsid();
|
setsid();
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
#include "xbm/xbm.h"
|
#include "xbm/xbm.h"
|
||||||
#include "menu/menu.h"
|
#include "menu/menu.h"
|
||||||
|
#include "common/fd_util.h"
|
||||||
|
|
||||||
struct rcxml rc = { 0 };
|
struct rcxml rc = { 0 };
|
||||||
|
|
||||||
|
|
@ -85,6 +86,8 @@ main(int argc, char *argv[])
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
increase_nofile_limit();
|
||||||
|
|
||||||
struct server server = { 0 };
|
struct server server = { 0 };
|
||||||
server_init(&server);
|
server_init(&server);
|
||||||
server_start(&server);
|
server_start(&server);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue