7EL6M5JX7NETLCKWGFWXU3ADIHQ2EKPCFHDMMDNFF5Y7WXHYG3ZAC
NYN4MT5TVKDWUKBXNYPHWA3SAU6P3UBIPEET7HEE4RZ5VIVPFQYQC
EQRGODLKSVSPFSUZU7BV5ER72U4QS4ATSBKV544XXQVKKTOSC7EAC
HFIKAPN3TBMDVBDG7SZLX4ZJMSFFDGINTO6C2SKO5IVYUILGCQEQC
7B74AT3BXYB7PVW4F6SGQNPMHOU5TEV5TZ54CG6VSQI46XSEKWXQC
int fd_set_nonblock(int fd);
#include <fcntl.h>
}intfd_set_nonblock(int fd) { int flags = fcntl(fd, F_GETFL); if (flags < 0) { perror("fcntl(F_GETFL):"); return -1; } if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) { perror("fcntl(F_SETFL):"); return -1; } return 0;
}
int
fd_set_nonblock(int fd) {
int flags = fcntl(fd, F_GETFL);
if (flags < 0) {
perror("fcntl(F_GETFL):");
return -1;
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) {
perror("fcntl(F_SETFL):");
return 0;
/* Mark stdout as non-blocking to avoid people who does not close stdin * nor consumes it in their startup script getting dwl frozen */ if (fd_set_nonblock(STDOUT_FILENO) < 0) close(STDOUT_FILENO);
/* Mark stdout as non-blocking to avoid people who does not close stdin
* nor consumes it in their startup script getting dwl frozen */
if (fd_set_nonblock(STDOUT_FILENO) < 0)
close(STDOUT_FILENO);