mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-15 18:00:59 +00:00
make utils.select posix-compat
This commit is contained in:
parent
1664a4fc29
commit
38aa463060
@ -1,5 +1,6 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define TREZOR_PORT 21324
|
||||
@ -10,9 +11,11 @@ static socklen_t slen = 0;
|
||||
|
||||
void msg_init(void)
|
||||
{
|
||||
s = socket(AF_INET, SOCK_DGRAM | SOCK_NONBLOCK, IPPROTO_UDP);
|
||||
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
assert(s != -1);
|
||||
|
||||
fcntl(s, F_SETFL, O_NONBLOCK);
|
||||
|
||||
si_me.sin_family = AF_INET;
|
||||
si_me.sin_port = htons(TREZOR_PORT);
|
||||
si_me.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
|
Loading…
Reference in New Issue
Block a user