From 40acbe34632b8e4e860fe41bb14ab5d7d5c9cfe9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 30 Nov 2023 12:23:30 +0100 Subject: udebug: wait for response after buffer add/remove Fixes a race condition where freeing a buffer and immediately re-allocating and adding it would fail to pass the file descriptor to udebugd Signed-off-by: Felix Fietkau --- udebug-priv.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'udebug-priv.h') diff --git a/udebug-priv.h b/udebug-priv.h index 9e43ddf..96373f9 100644 --- a/udebug-priv.h +++ b/udebug-priv.h @@ -25,9 +25,8 @@ #define UDEBUG_TIMEOUT 1000 __hidden int udebug_buf_open(struct udebug_buf *buf, int fd, uint32_t ring_size, uint32_t data_size); -__hidden struct udebug_client_msg *__udebug_poll(struct udebug *ctx, int *fd, bool wait); -__hidden void udebug_send_msg(struct udebug *ctx, struct udebug_client_msg *msg, - struct blob_attr *meta, int fd); +__hidden struct udebug_client_msg * +udebug_send_and_wait(struct udebug *ctx, struct udebug_client_msg *msg, int *rfd); static inline int32_t u32_sub(uint32_t a, uint32_t b) { -- cgit v1.2.3