return -1;
}
- ret = write(fd, busid, strnlen(busid, BUS_ID_SIZE));
+ ret = write(fd, busid, strnlen(busid, SYSFS_BUS_ID_SIZE));
if (ret < 0) {
dbg("write to unbind_path failed: %d", ret);
close(fd);
static int unbind_interface(char *busid, int configvalue, int interface)
{
- char inf_busid[BUS_ID_SIZE];
+ char inf_busid[SYSFS_BUS_ID_SIZE];
dbg("unbinding interface");
- snprintf(inf_busid, BUS_ID_SIZE, "%s:%d.%d", busid, configvalue, interface);
+ snprintf(inf_busid, SYSFS_BUS_ID_SIZE, "%s:%d.%d", busid, configvalue,
+ interface);
return unbind_interface_busid(inf_busid);
}
if (fd < 0)
return -1;
- ret = write(fd, busid, strnlen(busid, BUS_ID_SIZE));
+ ret = write(fd, busid, strnlen(busid, SYSFS_BUS_ID_SIZE));
if (ret < 0) {
close(fd);
return -1;
static int bind_interface(char *busid, int configvalue, int interface, char *driver)
{
- char inf_busid[BUS_ID_SIZE];
+ char inf_busid[SYSFS_BUS_ID_SIZE];
- snprintf(inf_busid, BUS_ID_SIZE, "%s:%d.%d", busid, configvalue, interface);
+ snprintf(inf_busid, SYSFS_BUS_ID_SIZE, "%s:%d.%d", busid, configvalue,
+ interface);
return bind_interface_busid(inf_busid, driver);
}
{
int fd;
int ret;
- char buff[BUS_ID_SIZE + 4];
+ char buff[SYSFS_BUS_ID_SIZE + 4];
char sysfs_mntpath[SYSFS_PATH_MAX];
char match_busid_path[SYSFS_PATH_MAX];
SYSFS_DRIVERS_NAME, USBIP_HOST_DRV_NAME);
/* BUS_IS_SIZE includes NULL termination? */
- if (strnlen(busid, BUS_ID_SIZE) > BUS_ID_SIZE - 1) {
+ if (strnlen(busid, SYSFS_BUS_ID_SIZE) > SYSFS_BUS_ID_SIZE - 1) {
dbg("busid is too long");
return -1;
}
return -1;
if (add)
- snprintf(buff, BUS_ID_SIZE + 4, "add %s", busid);
+ snprintf(buff, SYSFS_BUS_ID_SIZE + 4, "add %s", busid);
else
- snprintf(buff, BUS_ID_SIZE + 4, "del %s", busid);
+ snprintf(buff, SYSFS_BUS_ID_SIZE + 4, "del %s", busid);
dbg("write \"%s\" to %s", buff, match_busid_path);