Execute config file
This commit is contained in:
parent
cbe0f0cbe6
commit
972d001fd6
1 changed files with 28 additions and 0 deletions
|
@ -30,6 +30,8 @@ main(int argc, char *argv[])
|
|||
|
||||
@{open ipc connection}
|
||||
@{setup signal handlers}
|
||||
|
||||
@{execute config}
|
||||
}
|
||||
---
|
||||
|
||||
|
@ -254,3 +256,29 @@ Which of course requires this.
|
|||
#include <signal.h>
|
||||
#include <sys/wait.h>
|
||||
---
|
||||
|
||||
@s Execute config
|
||||
|
||||
We'll do this in a function, so we can execute later on, when the user requests it.
|
||||
|
||||
--- function definitions +=
|
||||
static void
|
||||
exec_config(const char *path)
|
||||
{
|
||||
switch (fork()) {
|
||||
case -1:
|
||||
fprintf(stderr, "%s: failed to execute config\n", argv0);
|
||||
break;
|
||||
case 0:
|
||||
execl(path, path, NULL);
|
||||
die("%s: failed to execute config\n", argv0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
---
|
||||
|
||||
We need to invoke this once all the connections are open
|
||||
|
||||
--- execute config
|
||||
exec_config(config_path);
|
||||
---
|
||||
|
|
Loading…
Add table
Reference in a new issue