termux/android: stdin: remove call to fcntl()

Remove an unnecessary call to put stdin into non-blocking mode. On
termux/android, xmppipe is aborted when the fd capability set is
changed:

```
FORTIFY: fcntl(F_SETFD) passed non-FD_CLOEXEC flag: 0x800
libc: FORTIFY: fcntl(F_SETFD) passed non-FD_CLOEXEC flag: 0x800
libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 32292
(xmppipe), pid 32292 (<unknown>)
libc: failed to spawn debuggerd dispatch thread: Try again
```
master
Michael Santos 5 months ago
parent bcb3cc20b6
commit 73e1f03625

@ -136,7 +136,6 @@ char *xmppipe_fmt_encode(const char *);
char *xmppipe_nfmt_encode(const char *, size_t);
char *xmppipe_fmt_decode(const char *);
char *xmppipe_nfmt_decode(const char *, size_t);
int xmppipe_set_nonblock(int fd);
char *xmppipe_resource(void);
char *xmppipe_servername(const char *);

@ -25,9 +25,6 @@ void event_loop(xmppipe_state_t *state) {
int eof = 0;
char *buf;
if (xmppipe_set_nonblock(fd) < 0)
return;
buf = xmppipe_calloc(state->bufsz, 1);
for (;;) {

@ -38,19 +38,6 @@ const char *const xmppipe_states[] = {"XMPPIPE_S_DISCONNECTED",
static char *xmppipe_join(const char *prefix, const char *delimiter, const char *suffix);
int xmppipe_set_nonblock(int fd) {
int flags;
flags = fcntl(fd, F_GETFD);
if (flags < 0)
return -1;
if (fcntl(fd, F_SETFD, flags | O_NONBLOCK) < 0)
return -1;
return 0;
}
char *xmppipe_getenv(const char *s) {
char *p = getenv(s);

Loading…
Cancel
Save