Use lockf instead of flock, the former works on NFS.
[util-vserver.git] / src / secure-mount.c
index a722f1f..a76f7a0 100644 (file)
@@ -279,8 +279,8 @@ updateMtab(struct MountInfo const *mnt, struct Options const *opt)
     goto err0;
   }
 
-  if (flock(fd, LOCK_EX)==-1) {
-    perror("secure-mount: flock()");
+  if (lockf(fd, F_LOCK, 0)==-1) {
+    perror("secure-mount: lockf()");
     goto err1;
   }