mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
connection: do not abort when dup(fd) fails
Instead, cleanly exit wl_closure_marshal and let the caller handler the error. For wayland-client, the sole calling function will call wl_abort() anyway. For wayland-server, the calling function will cleanly shutdown the client. This change ensures that compositors run with low file descriptor limits or internal leaks need not crash suddenly (and sometimes far from the problem) when space runs out. Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
This commit is contained in:
parent
a281783339
commit
9d63c9ff84
1 changed files with 6 additions and 2 deletions
|
|
@ -644,8 +644,12 @@ wl_closure_marshal(struct wl_object *sender, uint32_t opcode,
|
|||
case 'h':
|
||||
fd = args[i].h;
|
||||
dup_fd = wl_os_dupfd_cloexec(fd, 0);
|
||||
if (dup_fd < 0)
|
||||
wl_abort("dup failed: %s\n", strerror(errno));
|
||||
if (dup_fd < 0) {
|
||||
wl_closure_destroy(closure);
|
||||
wl_log("error marshalling arguments for %s: dup failed: %s\n",
|
||||
message->name, strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
closure->args[i].h = dup_fd;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue