Skip to content
Snippets Groups Projects
Commit 144854d2 authored by Simon McVittie's avatar Simon McVittie
Browse files

_srt_get_helper: Add support for wrapping executable in timeout(1)


This is basically the same as !46.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 0ecb5491
No related branches found
No related tags found
1 merge request!77Look for vulkaninfo, wflinfo in SRT_HELPERS_PATH
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
typedef enum typedef enum
{ {
SRT_HELPER_FLAGS_TIME_OUT = (1 << 1),
SRT_HELPER_FLAGS_TIME_OUT_SOONER = (1 << 2),
SRT_HELPER_FLAGS_NONE = 0 SRT_HELPER_FLAGS_NONE = 0
} SrtHelperFlags; } SrtHelperFlags;
......
...@@ -243,6 +243,27 @@ _srt_get_helper (const char *helpers_path, ...@@ -243,6 +243,27 @@ _srt_get_helper (const char *helpers_path,
argv = g_ptr_array_new_with_free_func (g_free); argv = g_ptr_array_new_with_free_func (g_free);
if (flags & SRT_HELPER_FLAGS_TIME_OUT)
{
g_ptr_array_add (argv, g_strdup ("timeout"));
g_ptr_array_add (argv, g_strdup ("--signal=TERM"));
if (flags & SRT_HELPER_FLAGS_TIME_OUT_SOONER)
{
/* Speed up the failing case in automated testing */
g_ptr_array_add (argv, g_strdup ("--kill-after=1"));
g_ptr_array_add (argv, g_strdup ("1"));
}
else
{
/* Kill the helper (if still running) 3 seconds after the TERM
* signal */
g_ptr_array_add (argv, g_strdup ("--kill-after=3"));
/* Send TERM signal after 10 seconds */
g_ptr_array_add (argv, g_strdup ("10"));
}
}
if (helpers_path == NULL) if (helpers_path == NULL)
{ {
helpers_path = _srt_get_helpers_path (error); helpers_path = _srt_get_helpers_path (error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment