libbb: add xfstat function
[platform/upstream/busybox.git] / util-linux / mkfs_reiser.c
index 6e172d6..00ce8f1 100644 (file)
@@ -168,9 +168,9 @@ int mkfs_reiser_main(int argc UNUSED_PARAM, char **argv)
 
        // check the device is a block device
        fd = xopen(argv[0], O_WRONLY | O_EXCL);
-       fstat(fd, &st);
+       xfstat(fd, &st, argv[0]);
        if (!S_ISBLK(st.st_mode) && !(option_mask32 & OPT_f))
-               bb_error_msg_and_die("not a block device");
+               bb_error_msg_and_die("%s: not a block device", argv[0]);
 
        // check if it is mounted
        // N.B. what if we format a file? find_mount_point will return false negative since