diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hotkey.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/hotkey.c b/src/hotkey.c index 168d24b..5e0190e 100644 --- a/src/hotkey.c +++ b/src/hotkey.c @@ -8,26 +8,6 @@ #define internal static #define local_persist static -internal bool -fork_and_exec(char *command) -{ - local_persist char arg[] = "-c"; - local_persist char *shell = NULL; - if(!shell) { - char *env_shell = getenv("SHELL"); - shell = env_shell ? env_shell : "/bin/bash"; - } - - int cpid = fork(); - if(cpid == 0) { - char *exec[] = { shell, arg, command, NULL}; - int status_code = execvp(exec[0], exec); - exit(status_code); - } - - return true; -} - #define LRMOD_ALT 0 #define LRMOD_CMD 6 #define LRMOD_CTRL 9 @@ -85,6 +65,26 @@ unsigned long hash_hotkey(struct hotkey *a) return a->key; } +internal bool +fork_and_exec(char *command) +{ + local_persist char arg[] = "-c"; + local_persist char *shell = NULL; + if(!shell) { + char *env_shell = getenv("SHELL"); + shell = env_shell ? env_shell : "/bin/bash"; + } + + int cpid = fork(); + if(cpid == 0) { + char *exec[] = { shell, arg, command, NULL}; + int status_code = execvp(exec[0], exec); + exit(status_code); + } + + return true; +} + bool find_and_exec_hotkey(struct hotkey *eventkey, struct table *hotkey_map) { bool result = false; |