diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-02-07 20:31:19 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-02-07 20:31:19 +0000 |
commit | 31cf8e00563a399768db0edda94ce1358e386dfa (patch) | |
tree | 63215d88f4f83e023ca889ff97545fe6d6df2686 /init | |
parent | 79ac30da83dfb16babbfc6d450a421f91752b3c8 (diff) | |
download | busybox-w32-31cf8e00563a399768db0edda94ce1358e386dfa.tar.gz busybox-w32-31cf8e00563a399768db0edda94ce1358e386dfa.tar.bz2 busybox-w32-31cf8e00563a399768db0edda94ce1358e386dfa.zip |
device_open is common code -- moved into utility.c
-Erik
Diffstat (limited to 'init')
-rw-r--r-- | init/init.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/init/init.c b/init/init.c index 2b1d21336..6dad7181b 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -115,25 +115,6 @@ static char termType[32] = "TERM=ansi"; | |||
115 | static char console[32] = _PATH_CONSOLE; | 115 | static char console[32] = _PATH_CONSOLE; |
116 | 116 | ||
117 | 117 | ||
118 | /* try to open up the specified device */ | ||
119 | int device_open(char *device, int mode) | ||
120 | { | ||
121 | int m, f, fd = -1; | ||
122 | |||
123 | m = mode | O_NONBLOCK; | ||
124 | |||
125 | /* Retry up to 5 times */ | ||
126 | for (f = 0; f < 5; f++) | ||
127 | if ((fd = open(device, m, 0600)) >= 0) | ||
128 | break; | ||
129 | if (fd < 0) | ||
130 | return fd; | ||
131 | /* Reset original flags. */ | ||
132 | if (m != mode) | ||
133 | fcntl(fd, F_SETFL, mode); | ||
134 | return fd; | ||
135 | } | ||
136 | |||
137 | /* print a message to the specified device: | 118 | /* print a message to the specified device: |
138 | * device may be bitwise-or'd from LOG | CONSOLE */ | 119 | * device may be bitwise-or'd from LOG | CONSOLE */ |
139 | void message(int device, char *fmt, ...) | 120 | void message(int device, char *fmt, ...) |