This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2-tracer: stop waiting to handle a signal
Author:  Deborah Brouwer <deborah.brou...@collabora.com>
Date:    Thu Nov 30 16:46:33 2023 -0800

Usually the v4l2-tracer will wait for its tracee to handle a signal e.g.
from ctrl+c before the v4l2-tracer exits, but if there is no tracee,
then the v4l2-tracer waits forever.

Exit gracefully by waiting only if a tracee exists.

Signed-off-by: Deborah Brouwer <deborah.brou...@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/v4l2-tracer/v4l2-tracer.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=703ff54eacaa90ffd031bb62394a4112da50c175
diff --git a/utils/v4l2-tracer/v4l2-tracer.cpp 
b/utils/v4l2-tracer/v4l2-tracer.cpp
index 37e17eb6c50c..05e5b3685b61 100644
--- a/utils/v4l2-tracer/v4l2-tracer.cpp
+++ b/utils/v4l2-tracer/v4l2-tracer.cpp
@@ -16,9 +16,12 @@ pid_t tracee_pid = 0;
 void v4l2_tracer_sig_handler(int signum)
 {
        line_info("\n\tReceived signum: %d", signum);
-       kill(tracee_pid, signum);
-       /* Wait for tracee to handle the signal first before v4l2-tracer exits. 
*/
-       wait(nullptr);
+
+       /* If there is a tracee, wait for it to handle the signal first before 
exiting. */
+       if (tracee_pid) {
+               kill(tracee_pid, signum);
+               wait(nullptr);
+       }
 }
 
 enum Options {

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to