summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-03-22 18:39:00 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-03-22 18:39:00 +0100
commita160fd6984cc317c35fd8a2ad2120f482737fcfe (patch)
tree11b3c59acb7048f7ea03f2e57b03bc8e94d9ffd3 /src
parentd04a6b1e183c5bfbc0958d51d9802ea526568792 (diff)
open_fifo delete existing buffer if needed
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/commands.cc b/src/commands.cc
index f8a5a74d..90ba937a 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -52,6 +52,9 @@ Buffer* open_fifo(const String& name , const String& filename, Context& context)
fcntl(fd, F_SETFD, FD_CLOEXEC);
if (fd < 0)
throw runtime_error("unable to open " + filename);
+
+ delete BufferManager::instance().get_buffer_ifp(name);
+
Buffer* buffer = new Buffer(name, Buffer::Flags::Fifo | Buffer::Flags::NoUndo);
auto watcher = new FDWatcher(fd, [buffer](FDWatcher& watcher) {