diff options
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); |
