check_failed(stringify(cond), __func__, __FILE__, __LINE__); \
} while(0)
+#define CHECK_ERRNO() do { \
+ if (args.power_cut_mode) \
+ CHECK(errno == EROFS); \
+ else \
+ CHECK(0); \
+} while(0)
+
#define pcv(fmt, ...) do { \
if (!args.power_cut_mode || (args.power_cut_mode && args.verbose)) \
normsg(fmt " (line %d, error %d (%s))", \
##__VA_ARGS__, __LINE__, errno, strerror(errno)); \
- if (!args.power_cut_mode) \
- CHECK(0); \
+ CHECK_ERRNO(); \
} while(0)
/* The variables below are set by command line arguments */