summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2010-08-22 05:39:15 +0200
committerDenys Vlasenko2010-08-22 05:39:15 +0200
commite7b0a9e5bc60617fb00c321430253d7771d40fd3 (patch)
tree5152c7e606fb72423de8d56c5c97a977c6852033 /libbb
parentfd27fa83094a85b3e8cb0485467ffa65b572b923 (diff)
downloadbusybox-e7b0a9e5bc60617fb00c321430253d7771d40fd3.zip
busybox-e7b0a9e5bc60617fb00c321430253d7771d40fd3.tar.gz
patch: support "patch [FILE [PATCH]]" format
function old new delta xopen_stdin - 15 +15 patch_main 2075 2041 -34 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/wfopen_input.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c
index 7263c93..422a58e 100644
--- a/libbb/wfopen_input.c
+++ b/libbb/wfopen_input.c
@@ -46,3 +46,11 @@ int FAST_FUNC open_or_warn_stdin(const char *filename)
return fd;
}
+
+int FAST_FUNC xopen_stdin(const char *filename)
+{
+ int fd = open_or_warn_stdin(filename);
+ if (fd >= 0)
+ return fd;
+ xfunc_die(); /* We already output an error message. */
+}