Add F_GETFL support (which does actually nothing
authorCedric Bail <cedric.bail@free.fr>
Sun, 10 Mar 2013 16:53:45 +0000 (17:53 +0100)
committerCedric BAIL <cedric.bail@samsung.com>
Mon, 11 Mar 2013 01:34:47 +0000 (10:34 +0900)
src/lib/evil/evil_fcntl.c
src/lib/evil/evil_fcntl.h

index 7c62c2a..aa68ec1 100644 (file)
@@ -62,12 +62,16 @@ int fcntl(int fd, int cmd, ...)
 #endif /* ! __MINGW32CE__ */
           }
      }
+   else if (cmd == F_GETFL)
+     {
+        /* does nothing*/
+     }
    else if (cmd == F_SETFL)
      {
         long flag;
 
         flag = va_arg(va, long);
-        if (flag == O_NONBLOCK)
+        if (flag & O_NONBLOCK)
           {
              u_long arg = 1;
              int    type;
index 194341b..a545696 100644 (file)
@@ -39,6 +39,7 @@
 
 # define F_GETFD    1
 # define F_SETFD    2
+# define F_GETFL    3
 # define F_SETFL    4
 # define F_SETLK    6
 # define F_SETLKW   7