-#ifndef MINGW
- fdatasync (fd);
- memset (&fl, 0, sizeof (struct flock));
- fl.l_type = F_UNLCK;
- fl.l_whence = SEEK_SET;
- fl.l_len = sizeof (struct RsaPrivateKeyBinaryEncoded);
- if (0 != fcntl (fd, F_SETLK, &fl))
- GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
- "fcntl", filename);
-#endif
- GNUNET_assert (0 == CLOSE (fd));
+
+ GNUNET_DISK_file_sync (fd);
+ if (GNUNET_YES !=
+ GNUNET_DISK_file_unlock (fd, 0,
+ sizeof (struct
+ RsaPrivateKeyBinaryEncoded)))
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fcntl",
+ filename);
+ GNUNET_assert (GNUNET_YES == GNUNET_DISK_file_close (fd));
+ GNUNET_CRYPTO_rsa_key_get_public (ret, &pub);
+ GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey);