summaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-09-24 05:58:02 -0700
committerDan Williams <dan.j.williams@intel.com>2008-10-15 14:15:51 -0700
commit2a24d7b6964546a83409cc1300615b046767d013 (patch)
tree53b94b40a6f54654dad5c8537d43485132d46486 /sysfs.c
parentc92a2527e1f36ae8e3e83e0d7ca3ed5d269906ef (diff)
downloadmdadm-2a24d7b6964546a83409cc1300615b046767d013.tar.gz
mdadm-2a24d7b6964546a83409cc1300615b046767d013.tar.xz
mdadm-2a24d7b6964546a83409cc1300615b046767d013.zip
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 <dan.j.williams@intel.com>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c5
1 files changed, 4 insertions, 1 deletions
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;
}