diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c index 89e37e93..9d2e6ff6 100644 --- a/src/libply/ply-utils.c +++ b/src/libply/ply-utils.c @@ -1015,4 +1015,16 @@ ply_get_device_scale (uint32_t width, return device_scale; } +bool +ply_run_program_in_background (const char *program) +{ + pid_t pid; + int result; + char argv[2] = { program, NULL }; + + result = posix_spawn (&pid, program, NULL, NULL, argv, NULL); + + return result == 0; +} + /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */ diff --git a/src/libply/ply-utils.h b/src/libply/ply-utils.h index c46603ee..19c5f90d 100644 --- a/src/libply/ply-utils.h +++ b/src/libply/ply-utils.h @@ -127,6 +127,7 @@ int ply_get_device_scale (uint32_t width, uint32_t height, uint32_t width_mm, uint32_t height_mm); +bool ply_run_program_in_background (const char *program); #endif