diff options
| author | miguel <miguel@localhost> | 2018-03-16 01:19:49 +0100 |
|---|---|---|
| committer | miguel <miguel@localhost> | 2018-03-16 01:19:49 +0100 |
| commit | 6d09938230f85faebe2acaf6f54496117f5dbe34 (patch) | |
| tree | d5f0b453f8855fc96d4567e83a82a30bd284e473 /piper_webext.c | |
| parent | 9de609b8bb4e3624416a4fad47eaf820d870ac9c (diff) | |
modal keybindings and window spawning in existing process
Diffstat (limited to 'piper_webext.c')
| -rw-r--r-- | piper_webext.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/piper_webext.c b/piper_webext.c index 172039e..3d0d3c1 100644 --- a/piper_webext.c +++ b/piper_webext.c @@ -54,13 +54,22 @@ static int piper_lock(char *path) return pipe; } -void piper_init(char *path_in,char *path_out,void (*callback_func)(char *msg)) +void piper_init(char *path_in,char *path_out,void (*callback_func)(char *msg),char *url) { pipe_in_callback=callback_func; pipe_out_fd=piper_lock(path_out); if(pipe_out_fd==-1) { - g_print("can not get exclusive lock! Bailing out.\n"); + g_print("can not get exclusive lock! Sending messsage and Bailing out.\n"); + if(url!=NULL) + { + gchar *fullpath=getpath(path_in); + int pipe=open(fullpath, O_RDWR | O_CREAT | O_TRUNC); + g_print("pipe fd: %i",pipe); + write(pipe,url,strlen(url)); + write(pipe,"\n",1); + close(pipe); + } exit(0); } register_callback(path_in); |
