Skip to content

Commit

Permalink
fixup usb: fixed open flags
Browse files Browse the repository at this point in the history
Signed-off-by: John Sanpe <[email protected]>
  • Loading branch information
sanpeqf committed Jun 11, 2024
1 parent 94eb873 commit 8a8ce97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cmake/xdbd_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#cmakedefine XDBD_CONFIG_WIN
#cmakedefine XDBD_CONFIG_DEBUG_POOL

#if !defined(XDBD_CONFIG_LINUX) && !defined(XDBD_CONFIG_OSX) && !defined(XDBD_CONFIG_WIN)
# error "Unknow platform"
#endif

#define USB_ADB_PATH "/dev/adb/usb"
#define USB_FFS_ADB_PATH "/dev/usb-ffs/adb/"

Expand Down
6 changes: 3 additions & 3 deletions src/connection/usb/xdbd_connection_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ int xdbd_open_usb_listening_sockets(xdbd_t *xdbd) {

int xdbd_event_open_usb_connection(xdbd_usb_listening_t *uls) {

uls->fd_ctr = xdbd_open((char *)uls->ctr.data, 0);
uls->fd_ctr = xdbd_open((char *)uls->ctr.data, O_RDWR);
if (uls->fd_ctr < 0) {
bfdev_log_err("%s open failed: %m\n", uls->ctr.data);
return XDBD_ERR;
Expand All @@ -195,13 +195,13 @@ int xdbd_event_open_usb_connection(xdbd_usb_listening_t *uls) {
return usb_init_send(uls);
#endif

uls->fd_out = xdbd_open((char *)uls->out.data, 0);
uls->fd_out = xdbd_open((char *)uls->out.data, O_RDWR);
if (uls->fd_out < 0) {
bfdev_log_err("%s open failed: %m\n", uls->out.data);
return XDBD_ERR;
}

uls->fd_in = xdbd_open((char *)uls->in.data, 0);
uls->fd_in = xdbd_open((char *)uls->in.data, O_RDWR);
if (uls->fd_in < 0) {
bfdev_log_err("%s open failed: %m\n", uls->in.data);
return XDBD_ERR;
Expand Down

0 comments on commit 8a8ce97

Please sign in to comment.