readFifo :: FilePath -> IO ([String], IO ())
readFifo fp = do
  (reader, pipe) <- openFifo fp
  tid <- forkIO reader
  l <- readFifo' pipe
  m <- newEmptyMVar
  forkIO $ takeMVar m >> killThread tid
  return (l, putMVar m ())
#else
readFifo :: FilePath -> IO ([String], IO ())
readFifo _ = return ([], return ())
#endif
readFifo :: FilePath -> IO ([String], IO ())
readFifo fp = do
  (reader, pipe) <- openFifo fp
  tid <- forkIO reader
  l <- readFifo' pipe
  m <- newEmptyMVar
  forkIO $ takeMVar m >> killThread tid
  return (l, putMVar m ())
#else
readFifo :: FilePath -> IO ([String], IO ())
readFifo _ = return ([], return ())
#endif
readFifo fp = do
  (reader, pipe) <- openFifo fp
  tid <- forkIO reader
  l <- readFifo' pipe
  m <- newEmptyMVar
  forkIO $ takeMVar m >> killThread tid
  return (l, putMVar m ())
#else
readFifo :: FilePath -> IO ([String], IO ())
readFifo _ = return ([], return ())
#endif