mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-18 06:59:46 -05:00
Put the fd in the closure so debugging can print it
This commit is contained in:
parent
65772ce18b
commit
5029a13283
1 changed files with 7 additions and 1 deletions
|
|
@ -369,7 +369,7 @@ wl_connection_vmarshal(struct wl_connection *connection,
|
||||||
struct wl_array **arrayp, *array;
|
struct wl_array **arrayp, *array;
|
||||||
const char **sp, *s;
|
const char **sp, *s;
|
||||||
char *extra;
|
char *extra;
|
||||||
int i, count, fd, extra_size;
|
int i, count, fd, extra_size, *fd_ptr;
|
||||||
|
|
||||||
extra_size = wl_message_size_extra(message);
|
extra_size = wl_message_size_extra(message);
|
||||||
count = strlen(message->signature) + 2;
|
count = strlen(message->signature) + 2;
|
||||||
|
|
@ -449,12 +449,18 @@ wl_connection_vmarshal(struct wl_connection *connection,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
|
closure->types[i] = &ffi_type_sint;
|
||||||
|
closure->args[i] = extra;
|
||||||
|
fd_ptr = (int *) extra;
|
||||||
|
extra += sizeof *fd_ptr;
|
||||||
|
|
||||||
fd = va_arg(ap, int);
|
fd = va_arg(ap, int);
|
||||||
dup_fd = dup(fd);
|
dup_fd = dup(fd);
|
||||||
if (dup_fd < 0) {
|
if (dup_fd < 0) {
|
||||||
fprintf(stderr, "dup failed: %m");
|
fprintf(stderr, "dup failed: %m");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
*fd_ptr = dup_fd;
|
||||||
wl_buffer_put(&connection->fds_out,
|
wl_buffer_put(&connection->fds_out,
|
||||||
&dup_fd, sizeof dup_fd);
|
&dup_fd, sizeof dup_fd);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue