Whamcloud - gitweb
LU-5456 hsm: hold inode mutex around ll_setattr_raw()
[fs/lustre-release.git] / libsysio / src / fcntl.c
index 22e0bcd..64f6a2c 100644 (file)
  */
 
 #include <string.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <assert.h>
 #include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <fcntl.h>
 #include <sys/queue.h>
 
@@ -57,7 +58,7 @@
 #include "sysio-symbols.h"
 
 #ifdef HAVE_LUSTRE_HACK
-#include <syscall.h>
+#include <sys/syscall.h>
 #include <native.h>
 #endif
 
@@ -193,14 +194,14 @@ _sysio_vfcntl(int fd, int cmd, va_list ap)
                        }
                }
                break;
-#if !(_LARGEFILE64_SOURCE || F_GETLK64 == F_GETLK)
+#if !(defined(_LARGEFILE64_SOURCE) || F_GETLK64 == F_GETLK)
            case F_GETLK:
            case F_SETLK:
            case F_SETLKW:
                {
                        struct intnl_stat buf;
                        struct flock *fl;
-#if _LARGEFILE64_SOURCE
+#ifdef _LARGEFILE64_SOURCE
                        struct _SYSIO_FLOCK flock64;
 #endif
 
@@ -219,7 +220,7 @@ _sysio_vfcntl(int fd, int cmd, va_list ap)
                         * Copy args to a temp and normalize.
                         */
                        fl = va_arg(ap, struct flock *);
-#if _LARGEFILE64_SOURCE
+#ifdef _LARGEFILE64_SOURCE
                        flock64.l_type = fl->l_type;
                        flock64.l_whence = fl->l_whence;
                        flock64.l_start = fl->l_start;
@@ -233,7 +234,7 @@ _sysio_vfcntl(int fd, int cmd, va_list ap)
                                rtn = -1;
                                break;
                        }
-#if _LARGEFILE64_SOURCE
+#ifdef _LARGEFILE64_SOURCE
                        /*
                         * Copy back. Note that the fcntl_lock call
                         * should have ensured that no overflow was possible.
@@ -250,7 +251,7 @@ _sysio_vfcntl(int fd, int cmd, va_list ap)
                }
                break;
 #endif /* !(_LARGEFILE64_SOURCE || F_GETLK64 == F_GETLK) */
-#if _LARGEFILE64_SOURCE
+#ifdef _LARGEFILE64_SOURCE
            case F_GETLK64:
            case F_SETLK64:
            case F_SETLKW64: