diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-03-22 18:39:00 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-03-22 18:39:00 +0100 |
| commit | a160fd6984cc317c35fd8a2ad2120f482737fcfe (patch) | |
| tree | 11b3c59acb7048f7ea03f2e57b03bc8e94d9ffd3 /src | |
| parent | d04a6b1e183c5bfbc0958d51d9802ea526568792 (diff) | |
open_fifo delete existing buffer if needed
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.cc | 3 |
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) { |
