diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2009-10-26 23:27:08 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-27 17:17:34 +0100 |
commit | a48308701a4d89d7cc0d0557cfabaec94a0bb3b0 (patch) | |
tree | a7b2baa086249a6c37c3479f28f4a680a1133a64 /libbb | |
parent | ca254490d703c750390042c9afa21d1537c90e9a (diff) | |
download | busybox-w32-a48308701a4d89d7cc0d0557cfabaec94a0bb3b0.tar.gz busybox-w32-a48308701a4d89d7cc0d0557cfabaec94a0bb3b0.tar.bz2 busybox-w32-a48308701a4d89d7cc0d0557cfabaec94a0bb3b0.zip |
add and use xopen_nonblocking (-18b)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xfuncs_printf.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index 345c84219..241887ace 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c | |||
@@ -140,6 +140,15 @@ int FAST_FUNC xopen(const char *pathname, int flags) | |||
140 | return xopen3(pathname, flags, 0666); | 140 | return xopen3(pathname, flags, 0666); |
141 | } | 141 | } |
142 | 142 | ||
143 | /* Die if we can't open an existing file readonly with O_NONBLOCK | ||
144 | * and return the fd. | ||
145 | * Note that for ioctl O_RDONLY is sufficient. | ||
146 | */ | ||
147 | int FAST_FUNC xopen_nonblocking(const char *pathname) | ||
148 | { | ||
149 | return xopen(pathname, O_RDONLY | O_NONBLOCK); | ||
150 | } | ||
151 | |||
143 | // Warn if we can't open a file and return a fd. | 152 | // Warn if we can't open a file and return a fd. |
144 | int FAST_FUNC open3_or_warn(const char *pathname, int flags, int mode) | 153 | int FAST_FUNC open3_or_warn(const char *pathname, int flags, int mode) |
145 | { | 154 | { |