libv4l2: decomress-helper: close fds then wait for helper to exit
authorHans de Goede <hdegoede@redhat.com>
Tue, 22 Apr 2014 09:38:39 +0000 (11:38 +0200)
committerHans de Goede <hdegoede@redhat.com>
Tue, 22 Apr 2014 09:38:39 +0000 (11:38 +0200)
Killing the helper does not always work (as it inherits its parent sigmask),
instead of meddling with the sigmask simply close the fds and wait for the
helper to cleanly exit.

Reported-by: Волков Андрей <volkov.am@ekb-info.ru>
Tested-by: Волков Андрей <volkov.am@ekb-info.ru>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
lib/libv4lconvert/helper.c

index 00e9e42..b15beb0 100644 (file)
@@ -212,12 +212,9 @@ void v4lconvert_helper_cleanup(struct v4lconvert_data *data)
        int status;
 
        if (data->decompress_pid != -1) {
-               kill(data->decompress_pid, SIGTERM);
-               waitpid(data->decompress_pid, &status, 0);
-
                close(data->decompress_out_pipe[WRITE_END]);
                close(data->decompress_in_pipe[READ_END]);
-
+               waitpid(data->decompress_pid, &status, 0);
                data->decompress_pid = -1;
        }
 }