File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 43
43
44
44
#include <netinet/in.h>
45
45
#include <sys/boardctl.h>
46
+ #include <sys/epoll.h>
46
47
#include <sys/ioctl.h>
47
48
#include <sys/param.h>
48
49
#include <sys/socket.h>
49
50
#include <sys/stat.h>
50
51
#include <sys/statfs.h>
51
52
#include <sys/types.h>
52
- #include <sys/poll.h>
53
53
#include <sys/wait.h>
54
54
55
55
/****************************************************************************
@@ -980,14 +980,27 @@ static void fastboot_oem(FAR struct fastboot_ctx_s *ctx, FAR const char *arg)
980
980
981
981
static void fastboot_command_loop (FAR struct fastboot_ctx_s * ctx )
982
982
{
983
+ struct epoll_event ev [1 ];
984
+ int epfd ;
985
+
983
986
if (ctx -> left > 0 )
984
987
{
985
- struct pollfd fds [1 ];
988
+ epfd = epoll_create (1 );
989
+ if (epfd < 0 )
990
+ {
991
+ fb_err ("open epoll failed %d" , errno );
992
+ return ;
993
+ }
986
994
987
- fds [0 ].fd = ctx -> tran_fd [0 ];
988
- fds [0 ].events = POLLIN ;
995
+ ev [0 ].events = EPOLLIN ;
996
+ ev [0 ].data .ptr = ctx ;
997
+ if (epoll_ctl (epfd , EPOLL_CTL_ADD , ctx -> tran_fd [0 ], & ev [0 ]) < 0 )
998
+ {
999
+ fb_err ("err add poll %d" , ctx -> tran_fd [0 ]);
1000
+ return ;
1001
+ }
989
1002
990
- if (poll ( fds , 1 , ctx -> left ) <= 0 )
1003
+ if (epoll_wait ( epfd , ev , nitems ( ev ) , ctx -> left ) <= 0 )
991
1004
{
992
1005
return ;
993
1006
}
You can’t perform that action at this time.
0 commit comments