]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
'errno' is a positive number, not negative.
authorNeil Brown <neilb@suse.de>
Mon, 26 May 2008 23:18:35 +0000 (09:18 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 26 May 2008 23:18:35 +0000 (09:18 +1000)
I've been living in the kernel too long ;-)

sysfs.c

diff --git a/sysfs.c b/sysfs.c
index ea7d52f6c025be17a47a1774e3bd5bec843fe261..dbfb55a85aee3d1e5846b4391405f4f473f90419 100644 (file)
--- a/sysfs.c
+++ b/sysfs.c
@@ -74,7 +74,7 @@ int sysfs_open(int devnum, char *devname, char *attr)
        }
        strcat(fname, attr);
        fd = open(fname, O_RDWR);
-       if (fd < 0 && errno == -EACCES)
+       if (fd < 0 && errno == EACCES)
                fd = open(fname, O_RDONLY);
        return fd;
 }