[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/soprano/server
From:       Patrick Spendrin <ps_ml () gmx ! de>
Date:       2007-10-10 17:31:39
Message-ID: 1192037499.206517.1383.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 723776 by sengels:

fctnl.h's struct flock isn't available under windows; disabling this feature - please don't hit me.

 M  +12 -6     lockfile.cpp  


--- trunk/kdesupport/soprano/server/lockfile.cpp #723775:723776
@@ -15,7 +15,10 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+
+#ifndef _WIN32
 #include <unistd.h>
+#endif
 
 #include <QtCore/QFile>
 #include <QtCore/QDebug>
@@ -75,17 +78,20 @@
         qDebug() << "(LockFile) could not open" << d->path;
         return false;
     }
-    struct flock lock;
-    lock.l_type = F_WRLCK;
-    lock.l_whence = SEEK_SET;
-    lock.l_start = 0;
-    lock.l_len = 0;
-    int r = fcntl( d->fd, F_SETLK, &lock );
+#ifndef _WIN32
+// flock isn't defined under windows
+    struct flock mlock;
+    mlock.l_type = F_WRLCK;
+    mlock.l_whence = SEEK_SET;
+    mlock.l_start = 0;
+    mlock.l_len = 0;
+    int r = fcntl( d->fd, F_SETLK, &mlock );
     if ( r == -1 ) {
         qDebug() << "(LockFile) could not set lock for" << d->path;
         close( d->fd );
         return false;
     }
+#endif /* _WIN32 */
     return true;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic