mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-25 18:56:30 +00:00
parent
487abc28ba
commit
986beef5be
1 changed files with 5 additions and 5 deletions
10
util.c
10
util.c
|
@ -38,14 +38,14 @@ ecalloc(size_t nmemb, size_t size)
|
||||||
int
|
int
|
||||||
fd_set_nonblock(int fd) {
|
fd_set_nonblock(int fd) {
|
||||||
int flags = fcntl(fd, F_GETFL);
|
int flags = fcntl(fd, F_GETFL);
|
||||||
if (flags < 0) {
|
if (flags < 0) {
|
||||||
perror("fcntl(F_GETFL):");
|
perror("fcntl(F_GETFL):");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
|
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
|
||||||
perror("fcntl(F_SETFL):");
|
perror("fcntl(F_SETFL):");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue