summaryrefslogtreecommitdiff
path: root/open.c
diff options
context:
space:
mode:
authortim <tim>1997-05-14 15:30:41 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:00 +0100
commit53cf1b1c1c3f0c2b5067afccc2976b99a574a089 (patch)
treea31f167c3779362e29ab377d662052b6257253a8 /open.c
parentb87bfedf65c289bf0ee5338c9e10492b70b1e8e0 (diff)
Initial revision
Diffstat (limited to 'open.c')
-rw-r--r--open.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/open.c b/open.c
deleted file mode 100644
index 2b6ee75..0000000
--- a/open.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* open.c: to insulate <fcntl.h> from the rest of rc. */
-
-#include <fcntl.h>
-#include "rc.h"
-
-/*
- Opens a file with the necessary flags. Assumes the following
- declaration for redirtype:
-
- enum redirtype {
- rFrom, rCreate, rAppend, rHeredoc, rHerestring
- };
-*/
-
-static const int mode_masks[] = {
- /* rFrom */ O_RDONLY,
- /* rCreate */ O_TRUNC | O_CREAT | O_WRONLY,
- /* rAppend */ O_APPEND | O_CREAT | O_WRONLY
-};
-
-extern int rc_open(const char *name, redirtype m) {
- if ((unsigned) m >= arraysize(mode_masks))
- panic("bad mode passed to rc_open");
- return open(name, mode_masks[m], 0666);
-}