summaryrefslogtreecommitdiff
path: root/libbb/xfuncs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/xfuncs.c')
-rw-r--r--libbb/xfuncs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 4bb05f2..e88a538 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -487,3 +487,13 @@ void xlisten(int s, int backlog)
if (listen(s, backlog)) bb_perror_msg_and_die("listen");
}
#endif
+
+#ifdef L_xstat
+/* xstat() - a stat() which dies on failure with meaningful error message */
+void xstat(const char * const name, struct stat *stat_buf)
+{
+ if (stat(name, stat_buf))
+ bb_perror_msg_and_die("Can't stat '%s'", name);
+}
+#endif
+