The address of msg is returned by the function in the OP_CHROOT case.
Whilst the way it is used means it is just a way of saying true/false,
the compiler doesn't know this and can warn and this isn't really
allowed.

The other pseudo funcitons in this area already use a static msg so
make this function match the others. There wouldn't be re-enterancy
in this context.

Need to be careful about clearing the data upon each function entry
and not just once at init.

Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
---
 pseudo_client.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pseudo_client.c b/pseudo_client.c
index 2583bca..546bdb1 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -1589,7 +1589,8 @@ int pseudo_client_ignore_path(const char *path) {
 pseudo_msg_t *
 pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char 
*path, const PSEUDO_STATBUF *buf, ...) {
        pseudo_msg_t *result = 0;
-       pseudo_msg_t msg = { .type = PSEUDO_MSG_OP };
+       static pseudo_msg_t msg;
+       msg = (pseudo_msg_t) { .type = PSEUDO_MSG_OP };
        size_t pathlen = -1;
        int do_request = 0;
        char *path_extra_1 = 0;
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#155859): 
https://lists.openembedded.org/g/openembedded-core/message/155859
Mute This Topic: https://lists.openembedded.org/mt/85487319/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to