return (*vers == '/' || *vers == '-');
}
+#ifdef DEBUG
+#define dprintf(fmt, arg...) \
+ fprintf(stderr, fmt, ##arg)
+#else
+#define dprintf(fmt, arg...) \
+ ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
+#endif
+
#define LEVEL_MULTIPATH (-4)
#define LEVEL_LINEAR (-1)
#define LEVEL_FAULTY (-5)
-#ifdef DEBUG
-#define dprintf(fmt, arg...) \
- fprintf(stderr, fmt, ##arg)
-#else
-#define dprintf(fmt, arg...) \
- ({ if (0) fprintf(stderr, fmt, ##arg); 0; })
-#endif
-
enum array_state { clear, inactive, suspended, readonly, read_auto,
clean, active, write_pending, active_idle, bad_word};
return -1;
n = write(fd, val, strlen(val));
close(fd);
- if (n != strlen(val))
+ if (n != strlen(val)) {
+ dprintf(Name ": failed to write '%s' to '%s' (%s)\n",
+ val, fname, strerror(errno));
return -1;
+ }
return 0;
}