1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

core: Fix path for opening ffs endpoint ep0

usbffs_address_create() expects an absolute path to the file that is
supposed to be opened. The path specified only leads to the directory
containing the endpoint ep0 not the endpoint itself. This commit adds
the endpoints name to the path.
This commit is contained in:
Georgia Brikis 2016-03-22 12:08:42 +01:00
parent 99d91109a6
commit 27a6ea9163

View File

@ -1341,8 +1341,12 @@ static int socket_open_fds(Socket *s) {
break;
case SOCKET_USB_FUNCTION:
{
_cleanup_free_ char *ep = NULL;
p->fd = usbffs_address_create(p->path);
ep = path_make_absolute("ep0", p->path);
p->fd = usbffs_address_create(ep);
if (p->fd < 0) {
r = p->fd;
goto rollback;
@ -1357,7 +1361,7 @@ static int socket_open_fds(Socket *s) {
goto rollback;
break;
}
default:
assert_not_reached("Unknown port type");
}