Write access is not needed until later.
Also fix handling of open() error code.
serialization of handle_events
0.1 compat layer
internal docs for OS porters
+passing of "access denied" error code from op_open
1.0 API style/naming points to reconsider
=========================================
snprintf(path, PATH_MAX, "%s/%03d/%03d", usbfs_path, busnum, devaddr);
usbi_dbg("%s", path);
- fd = open(path, O_RDWR);
- if (!fd) {
+ fd = open(path, O_RDONLY);
+ if (fd < 0) {
usbi_dbg("open '%s' failed, ret=%d errno=%d", path, fd, errno);
/* FIXME this might not be an error if the file has gone away due
* to unplugging */