[Rpm-maint] [rpm-software-management/rpm] Add macro to force fsync() on close() (#187)

Panu Matilainen notifications at github.com
Tue Apr 4 08:49:46 UTC 2017


pmatilai commented on this pull request.



> @@ -1116,6 +1116,28 @@ int Fseek(FD_t fd, off_t offset, int whence)
     return rc;
 }
 
+int Fsync(FD_t fd)
+{
+    int rc = 0, ec = 0;
+
+    if (fd == NULL)
+	return -1;
+
+    fd = fdLink(fd);
+    for (FDSTACK_t fps = fd->fps; fps != NULL; fps = fdPop(fd)) {

Mm, AFAICS this ends up destroying the fd. Which doesn't perhaps matter for this particular use, but for a general purpose public API that's not sensical behavior. Just walk the fps->prev chain instead.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/187#pullrequestreview-30718939
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170404/f653a4cc/attachment.html>


More information about the Rpm-maint mailing list