- fdatasync (fd);
- memset (&fl, 0, sizeof (struct flock));
- fl.l_type = F_UNLCK;
- fl.l_whence = SEEK_SET;
- fl.l_len = sizeof (struct RsaPrivateKeyBinaryEncoded);
- cnt = 0;
- if (0 != fcntl (fd, F_SETLK, &fl))
+
+ GNUNET_DISK_file_sync (fd);
+ if (GNUNET_YES != GNUNET_DISK_file_unlock (fd, 0, sizeof (struct RsaPrivateKeyBinaryEncoded)))