From 2a24d7b6964546a83409cc1300615b046767d013 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 24 Sep 2008 05:58:02 -0700 Subject: sysfs: dprintf when we fail to write a sysfs file When arrays do not startup correctly it would be nice to know why. Need to move the dprintf definition to mdadm.h Signed-off-by: Dan Williams --- sysfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sysfs.c') diff --git a/sysfs.c b/sysfs.c index 727e250..291a1dc 100644 --- a/sysfs.c +++ b/sysfs.c @@ -389,8 +389,11 @@ int sysfs_set_str(struct mdinfo *sra, struct mdinfo *dev, 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; } -- cgit