Patch from Denis Vlasenko to add xstat() and use it.
This commit is contained in:
11
libbb/xstat.c
Normal file
11
libbb/xstat.c
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
* xstat.c - a stat() which dies on failure with meaningful error message
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include "libbb.h"
|
||||
|
||||
void xstat(const char *name, struct stat *stat_buf)
|
||||
{
|
||||
if (stat(name, stat_buf))
|
||||
bb_perror_msg_and_die("Can't stat '%s'", name);
|
||||
}
|
Reference in New Issue
Block a user