diff options
author | Michael Labuschke <michael@labuschke.de> | 2006-10-23 14:56:35 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-10-23 14:56:35 +1000 |
commit | 3a43c8039227d5d4b0cf02c086b21bb65c145450 (patch) | |
tree | b118c92d4bc6927426a67abefb1f3c44039094fd | |
parent | 81074c9f7bd708413131a8fb7ba98440e59f7574 (diff) | |
download | mdadm-3a43c8039227d5d4b0cf02c086b21bb65c145450.tar.gz mdadm-3a43c8039227d5d4b0cf02c086b21bb65c145450.tar.xz mdadm-3a43c8039227d5d4b0cf02c086b21bb65c145450.zip |
Check error return on a couple of syscalls.
From: "Michael Labuschke" <michael@labuschke.de>
-rw-r--r-- | mdopen.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -44,7 +44,8 @@ void make_dev_symlink(char *dev) strcpy(new+7, new+8); else new[7] = '_'; - symlink(dev+5, new); + if (symlink(dev+5, new)) + perror(new); } @@ -249,8 +250,10 @@ int open_mddev(char *dev, int autof) if (strncmp(dev, "/dev/md/", 8) == 0) { if (mkdir("/dev/md",0700)==0) { - chown("/dev/md", ci->uid, ci->gid); - chmod("/dev/md", ci->mode| ((ci->mode>>2) & 0111)); + if (chown("/dev/md", ci->uid, ci->gid)) + perror("chown /dev/md"); + if (chmod("/dev/md", ci->mode| ((ci->mode>>2) & 0111))) + perror("chmod /dev/md"); } } if (mknod(dev, S_IFBLK|0600, makedev(major, minor))!= 0) { |