diff mbox

[hwc,v2,03/18] drm_hwcomposer: drmeventlistener: Set nl_pid to 0

Message ID 1523460149-1740-4-git-send-email-alexandru-cosmin.gheorghe@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexandru-Cosmin Gheorghe April 11, 2018, 3:22 p.m. UTC
By setting nl_pid to 0, we let the kernel to assign a port for us.
In the current implementation there is no way we could create more
than one instance for drmeventlistener.

Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
---
 drmeventlistener.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Robert Foss April 16, 2018, 10:32 a.m. UTC | #1
Hey Alexandru,

Feel free to add my SoB to this patch:
Signed-off-by: Robert Foss <robert.foss@collabora.com>


Rob.

On 04/11/2018 05:22 PM, Alexandru Gheorghe wrote:
> By setting nl_pid to 0, we let the kernel to assign a port for us.
> In the current implementation there is no way we could create more
> than one instance for drmeventlistener.
> 
> Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
> ---
>   drmeventlistener.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drmeventlistener.cpp b/drmeventlistener.cpp
> index 984d1dd..5534182 100644
> --- a/drmeventlistener.cpp
> +++ b/drmeventlistener.cpp
> @@ -46,7 +46,7 @@ int DrmEventListener::Init() {
>     struct sockaddr_nl addr;
>     memset(&addr, 0, sizeof(addr));
>     addr.nl_family = AF_NETLINK;
> -  addr.nl_pid = getpid();
> +  addr.nl_pid = 0;
>     addr.nl_groups = 0xFFFFFFFF;
>   
>     int ret = bind(uevent_fd_.get(), (struct sockaddr *)&addr, sizeof(addr));
>
diff mbox

Patch

diff --git a/drmeventlistener.cpp b/drmeventlistener.cpp
index 984d1dd..5534182 100644
--- a/drmeventlistener.cpp
+++ b/drmeventlistener.cpp
@@ -46,7 +46,7 @@  int DrmEventListener::Init() {
   struct sockaddr_nl addr;
   memset(&addr, 0, sizeof(addr));
   addr.nl_family = AF_NETLINK;
-  addr.nl_pid = getpid();
+  addr.nl_pid = 0;
   addr.nl_groups = 0xFFFFFFFF;
 
   int ret = bind(uevent_fd_.get(), (struct sockaddr *)&addr, sizeof(addr));