From: Neil Brown Date: Mon, 26 May 2008 23:18:35 +0000 (+1000) Subject: 'errno' is a positive number, not negative. X-Git-Tag: devel~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea6d09b063211c851441f407c286d179fd3a3baa;p=thirdparty%2Fmdadm.git 'errno' is a positive number, not negative. I've been living in the kernel too long ;-) --- diff --git a/sysfs.c b/sysfs.c index ea7d52f6..dbfb55a8 100644 --- 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; }