'errno' is a positive number, not negative.

I've been living in the kernel too long ;-)
This commit is contained in:
Neil Brown 2008-05-27 09:18:35 +10:00
parent 355726fa01
commit ea6d09b063
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}