mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 12:28:12 +02:00
utils: add function for running program
In order to hand off the drm fd to another program we need to be able to run that other program. This commit adds an API for running a program with no arguments, in the background.
This commit is contained in:
parent
55186d76ab
commit
0faf4c82bf
2 changed files with 13 additions and 0 deletions
|
|
@ -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: */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue