lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / libbb / wfopen_input.c
index 7263c933a4dfe7fba797525248daf4ecc40c80ec..422a58ecffda9ad30dbfb1abe1718c88768f6900 100644 (file)
@@ -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. */
+}