From e7b0a9e5bc60617fb00c321430253d7771d40fd3 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 22 Aug 2010 05:39:15 +0200 Subject: patch: support "patch [FILE [PATCH]]" format function old new delta xopen_stdin - 15 +15 patch_main 2075 2041 -34 Signed-off-by: Denys Vlasenko --- libbb/wfopen_input.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbb/wfopen_input.c') diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c index 7263c933a..422a58ecf 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. */ +} -- cgit v1.2.3