diff options
author | uranther <jwheaton@purdue.edu> | 2009-06-03 19:55:26 -0400 |
---|---|---|
committer | uranther <jwheaton@purdue.edu> | 2009-06-03 19:55:26 -0400 |
commit | 718ce1aa8bd2e514816a51bd80cc29d41da13fb5 (patch) | |
tree | 30d7310beb04ba2ab862f1bfb8e4ee5d545c0ba4 /uzbl.c | |
parent | de5ccaf4fbe7ba410b4759b601ad5ff01e3d4138 (diff) |
fixed an issue where uzbl's fifo would not work if the fifo already existed
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1680,6 +1680,12 @@ init_fifo(gchar *dir) { /* return dir or, on error, free dir and return NULL */ GError *error = NULL; gchar *path = build_stream_name(FIFO, dir); + // This extra check is an alternative to recursively calling init_fifo() or using goto + if (file_exists(path)) { + if (unlink(path)) + g_warning ("init_fifo: can't delete %s: %s", path, strerror(errno)); + } + if (!file_exists(path)) { if (mkfifo (path, 0666) == 0) { // we don't really need to write to the file, but if we open the file as 'r' we will block here, waiting for a writer to open the file. |