+/* ----------------------- */
+static int set_lock(int fd, int cmd, struct flock *lock)
+{
+ if (!fd) {
+ /* We assign fd = 0 for symlinks -> do nothing */
+ if (cmd == F_GETLK)
+ lock->l_type = F_UNLCK;
+ return 0;
+ }
+ return fcntl(fd, cmd, lock);
+}
+