Created attachment 1170337 [details] 0001-install-info-Use-create-tmp-then-rename-pattern.patch From 23c3374a73a438029c17bcf385e7486754bead7a Mon Sep 17 00:00:00 2001 From: Colin Walters <walters> Date: Tue, 21 Jun 2016 13:02:04 -0400 Subject: [PATCH] install-info: Use create-tmp-then-rename pattern rpm-ostree uses https://github.com/ostreedev/ostree/blob/master/man/rofiles-fuse.xml when running `%post` scripts, to avoid corruption of the underlying hardlink store. Switch to that pattern to be compatible. --- install-info/install-info.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/install-info/install-info.c b/install-info/install-info.c index 4e39122..ef29eaf 100644 --- a/install-info/install-info.c +++ b/install-info/install-info.c @@ -954,18 +954,23 @@ output_dirfile (char *dirfile, int dir_nlines, struct line_data *dir_lines, int n_entries_added = 0; int i; FILE *output; + char *dirfile_tmp = NULL; + + asprintf (&dirfile_tmp, "%s.tmp", dirfile); + if (!dirfile_tmp) + xalloc_die (); if (compression_program) { - char *command = concat (compression_program, ">", dirfile); + char *command = concat (compression_program, ">", dirfile_tmp); output = popen (command, "w"); } else - output = fopen (dirfile, "w"); + output = fopen (dirfile_tmp, "w"); if (!output) { - perror (dirfile); + perror (dirfile_tmp); exit (EXIT_FAILURE); } @@ -1076,6 +1081,12 @@ output_dirfile (char *dirfile, int dir_nlines, struct line_data *dir_lines, pclose (output); else fclose (output); + + if (rename (dirfile_tmp, dirfile) < 0) + { + perror (dirfile_tmp); + exit (EXIT_FAILURE); + } } ^L /* Parse the input to find the section names and the entry names it -- 2.5.5
I would add free (dirfile_tmp) at the end, otherwise the patch looks fine, I'll apply it. Thanks.
Yep, sorry - I had the free() in a version of this patch, but I lost it when juggling multiple branches. Thanks for the review!
texinfo-6.1-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-81e90d2724
texinfo-6.0-3.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-e9bc854cca
texinfo-6.0-3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e9bc854cca
texinfo-6.1-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-81e90d2724
texinfo-6.1-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
texinfo-6.0-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.