summaryrefslogtreecommitdiff
path: root/src/skaembutils/seekablepipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/skaembutils/seekablepipe.c')
-rw-r--r--src/skaembutils/seekablepipe.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/skaembutils/seekablepipe.c b/src/skaembutils/seekablepipe.c
deleted file mode 100644
index 5ae6a2d..0000000
--- a/src/skaembutils/seekablepipe.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ISC license. */
-
-#include <unistd.h>
-
-#include <skalibs/posixplz.h>
-#include <skalibs/strerr.h>
-#include <skalibs/djbunix.h>
-#include <skalibs/exec.h>
-
-#define USAGE "seekablepipe tempfile prog..."
-
-int main (int argc, char const *const *argv)
-{
- int fdr, fdw ;
- PROG = "seekablepipe" ;
- if (argc < 3) strerr_dieusage(100, USAGE) ;
- fdw = open_trunc(argv[1]) ;
- if (fdw < 0)
- strerr_diefu2sys(111, "create temporary ", argv[1]) ;
- fdr = open_readb(argv[1]) ;
- if (fdr < 0)
- strerr_diefu3sys(111, "open ", argv[1], " for reading") ;
- unlink_void(argv[1]) ;
- if (ndelay_off(fdw) < 0)
- strerr_diefu1sys(111, "set fdw blocking") ;
- if (fd_cat(0, fdw) < 0)
- strerr_diefu1sys(111, "read from stdin") ;
- close(fdw) ;
- if (fd_move(0, fdr) < 0)
- strerr_diefu1sys(111, "move temporary file descriptor") ;
- xexec(argv+2) ;
-}