summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/hdcp/hdcp/0001-main-fix-hdcpd-service-failure.patch
blob: f07d466f2a5e25ee038143f25bdb0443355abd0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 5cbcecff0bb7fa1c617d3082e7ad94c22e5f4eb1 Mon Sep 17 00:00:00 2001
From: Naveen Saini <naveen.kumar.saini@intel.com>
Date: Wed, 3 Jul 2019 17:13:15 +0800
Subject: [PATCH] main: fix hdcpd service failure

Child process not able to finish before parent process
exits, which causing hdcpd service failure.

Added wait function to block parent process
until child process exits.

Upstream-Status: Submitted[https://github.com/intel/hdcp/pull/17]

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
 daemon/main.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/daemon/main.cpp b/daemon/main.cpp
index 9a028d7..ef1e047 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -36,6 +36,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <iostream>
+#include <sys/wait.h>
 
 #include "hdcpdef.h"
 #include "srm.h"
@@ -93,6 +94,8 @@ int32_t daemon_init(void)
     }
     else if (pid != 0)
     {
+        int status;
+        wait(&status);
         exit(SUCCESS);    // parent exit
     }
 
-- 
2.17.1