All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] dbus: Handle the 'h' type in append_arguments
@ 2016-04-29 22:43 Andrew Zaborowski
  2016-04-29 22:43 ` [PATCH 2/5] dbus: Remove memcpy and fix setting of FD_CLOEXEC on FDs Andrew Zaborowski
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Andrew Zaborowski @ 2016-04-29 22:43 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

FD values can't be handled same as int32 values ('i' and 'u').
---
 ell/dbus-message.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/ell/dbus-message.c b/ell/dbus-message.c
index 6089295..038d44d 100644
--- a/ell/dbus-message.c
+++ b/ell/dbus-message.c
@@ -1140,7 +1140,6 @@ static bool append_arguments(struct l_dbus_message *message,
 		}
 		case 'i':
 		case 'u':
-		case 'h':
 		{
 			uint32_t u = va_arg(args, uint32_t);
 
@@ -1149,6 +1148,20 @@ static bool append_arguments(struct l_dbus_message *message,
 
 			break;
 		}
+		case 'h':
+		{
+			int fd = va_arg(args, int);
+
+			if (!driver->append_basic(builder, *s,
+							&message->num_fds))
+				goto error;
+
+			if (message->num_fds < L_ARRAY_SIZE(message->fds))
+				message->fds[message->num_fds++] =
+					fcntl(fd, F_DUPFD_CLOEXEC, 3);
+
+			break;
+		}
 		case 'x':
 		case 't':
 		{
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-05-03  3:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-29 22:43 [PATCH 1/5] dbus: Handle the 'h' type in append_arguments Andrew Zaborowski
2016-04-29 22:43 ` [PATCH 2/5] dbus: Remove memcpy and fix setting of FD_CLOEXEC on FDs Andrew Zaborowski
2016-04-29 23:20   ` Denis Kenzior
2016-04-29 22:44 ` [PATCH 3/5] dbus: Add and validate the UNIX_FDS msg header field Andrew Zaborowski
2016-04-29 23:17   ` Denis Kenzior
2016-04-29 23:52     ` Andrzej Zaborowski
2016-04-30  1:15       ` Denis Kenzior
2016-04-30 14:58         ` Andrzej Zaborowski
2016-05-02 15:10           ` Denis Kenzior
2016-05-02 22:25             ` Andrzej Zaborowski
2016-05-03  3:17               ` Denis Kenzior
2016-04-29 22:44 ` [PATCH 4/5] unit: Add UNIX_FDS header fields in FD test messages Andrew Zaborowski
2016-04-29 23:20   ` Denis Kenzior
2016-04-29 22:44 ` [PATCH 5/5] unit: End to end FD passing test Andrew Zaborowski
2016-04-29 23:21   ` Denis Kenzior
2016-04-29 23:20 ` [PATCH 1/5] dbus: Handle the 'h' type in append_arguments Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.