SRS: Set non-blocking flag without override
authorPaul Kocialkowski <contact@paulk.fr>
Mon, 12 Nov 2012 11:10:00 +0000 (12:10 +0100)
committerPaul Kocialkowski <contact@paulk.fr>
Mon, 12 Nov 2012 11:10:00 +0000 (12:10 +0100)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
srs.c

diff --git a/srs.c b/srs.c
index 13f50a5..4859778 100644 (file)
--- a/srs.c
+++ b/srs.c
@@ -457,6 +457,7 @@ int srs_read_loop(struct ril_client *client)
        struct sockaddr_un client_addr;
        int client_addr_len;
        pthread_attr_t attr;
+       int flags;
        int fd;
        int rc;
 
@@ -484,7 +485,9 @@ int srs_read_loop(struct ril_client *client)
                        break;
                }
 
-               fcntl(fd, F_SETFL, O_NONBLOCK);
+               flags = fcntl(fd, F_GETFL);
+               flags |= O_NONBLOCK;
+               fcntl(fd, F_SETFL, flags);
 
                LOGD("Accepted new SRS client from fd %d", fd);