Build on systems without fcntl
authorAlan T. DeKok <aland@freeradius.org>
Tue, 22 Jun 2010 14:41:13 +0000 (16:41 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 28 Jun 2010 13:56:49 +0000 (15:56 +0200)
src/modules/rlm_sql_log/rlm_sql_log.c

index e27070a..2e6f72e 100644 (file)
@@ -339,6 +339,7 @@ static int sql_xlat_query(rlm_sql_log_t *inst, REQUEST *request, const char *que
  */
 static int setlock(int fd)
 {
+#ifdef F_WRLCK
        struct flock fl;
        memset(&fl, 0, sizeof(fl));
        fl.l_start = 0;
@@ -346,6 +347,9 @@ static int setlock(int fd)
        fl.l_type = F_WRLCK;
        fl.l_whence = SEEK_SET;
        return fcntl(fd, F_SETLKW, &fl);
+#else
+       return -1;
+#endif
 }
 
 /*