Re: Help testing release candidate / mc-4.8.28-rc1
On Sun, Mar 20, 2022 at 06:59:32PM +0300, Andrew Borodin wrote: On Sun, 20 Mar 2022 15:22:14 +0100 Oswald Buddenhagen via mc-devel wrote: `mc -P $file` doesn't work any more when the file already exists (which is of course the case after file=`mktemp`). Indeed. A following patch is proposed: diff --git a/src/main.c b/src/main.c index 3a33dfb59..a4910349a 100644 --- a/src/main.c +++ b/src/main.c @@ -492,6 +492,10 @@ main (int argc, char *argv[]) last_wd_fd = open (mc_args__last_wd_file, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR); + +if (last_wd_fd == -1 && errno == EEXIST) +last_wd_fd = open (mc_args__last_wd_file, O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR); + if (last_wd_fd != -1) { ssize_t ret1; that seems overly complicated - why not just drop the O_EXCL? at least i can't see an obvious reason for having it in the first place. anyway, i wonder why i ran into this only recently, given that this behavior is actually rather ancient. probably has something to do with me porting the wrapper function from tempfile to mktemp (as debian started to complain about deprecation), though the replacement itself couldn't have caused it. ___ mc-devel mailing list https://mail.gnome.org/mailman/listinfo/mc-devel
Re: Help testing release candidate / mc-4.8.28-rc1
On Sun, 20 Mar 2022 15:22:14 +0100 Oswald Buddenhagen via mc-devel wrote: > On Sun, Mar 20, 2022 at 01:15:41PM +0100, Yury V. Zaytsev wrote: > >TLDR; I would appreciate if you could please test the following tarball on > >your systems > and report any blocker regressions as compared to the previous 4.8.27 release: > > > i tested master instead: > > find.c: In function ‘find_cmd’: > find.c:1837:28: warning: ‘start_dir_len’ may be used uninitialized in this > function [-Wmaybe-uninitialized] > 1837 | p = name + (size_t) start_dir_len; >|^~ > find.c:1897:13: note: ‘start_dir_len’ was declared here > 1897 | ssize_t start_dir_len; >| ^ This isn't critical. start_dir_len is an output of find_parameters(). > coord_cache.c: In function ‘mcview_ccache_add_entry’: > coord_cache.c:97:5: warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' > instead [-Wdeprecated-declarations] > 97 | cache->cache[pos] = g_memdup (entry, sizeof (*entry)); >| ^ > In file included from /usr/include/glib-2.0/glib.h:82, > from ../../lib/global.h:66, > from coord_cache.c:57: > /usr/include/glib-2.0/glib/gstrfuncs.h:257:23: note: declared here >257 | gpointer g_memdup (gconstpointer mem, >| ^~~~ This is not critical too. https://midnight-commander.org/ticket/4270#comment:12 > `mc -P $file` doesn't work any more when the file already exists (which is of > course the case after file=`mktemp`). Indeed. file is opened with O_CREAT | O_EXCL flags. In this case, as written in open(2), O_EXCL Ensure that this call creates the file: if this flag is specified in conjunction with O_CREAT, and pathname already exists, then open() fails with the error EEXIST. A following patch is proposed: diff --git a/src/main.c b/src/main.c index 3a33dfb59..a4910349a 100644 --- a/src/main.c +++ b/src/main.c @@ -492,6 +492,10 @@ main (int argc, char *argv[]) last_wd_fd = open (mc_args__last_wd_file, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR); + +if (last_wd_fd == -1 && errno == EEXIST) +last_wd_fd = open (mc_args__last_wd_file, O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR); + if (last_wd_fd != -1) { ssize_t ret1; -- Andrew ___ mc-devel mailing list https://mail.gnome.org/mailman/listinfo/mc-devel
Re: Help testing release candidate / mc-4.8.28-rc1
On Sun, Mar 20, 2022 at 01:15:41PM +0100, Yury V. Zaytsev wrote: TLDR; I would appreciate if you could please test the following tarball on your systems and report any blocker regressions as compared to the previous 4.8.27 release: i tested master instead: find.c: In function ‘find_cmd’: find.c:1837:28: warning: ‘start_dir_len’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1837 | p = name + (size_t) start_dir_len; |^~ find.c:1897:13: note: ‘start_dir_len’ was declared here 1897 | ssize_t start_dir_len; | ^ coord_cache.c: In function ‘mcview_ccache_add_entry’: coord_cache.c:97:5: warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead [-Wdeprecated-declarations] 97 | cache->cache[pos] = g_memdup (entry, sizeof (*entry)); | ^ In file included from /usr/include/glib-2.0/glib.h:82, from ../../lib/global.h:66, from coord_cache.c:57: /usr/include/glib-2.0/glib/gstrfuncs.h:257:23: note: declared here 257 | gpointer g_memdup (gconstpointer mem, | ^~~~ `mc -P $file` doesn't work any more when the file already exists (which is of course the case after file=`mktemp`). ___ mc-devel mailing list https://mail.gnome.org/mailman/listinfo/mc-devel
Help testing release candidate / mc-4.8.28-rc1
Hi there, TLDR; I would appreciate if you could please test the following tarball on your systems and report any blocker regressions as compared to the previous 4.8.27 release: https://www.midnight-commander.org/nopaste/tarball/mc-4.8.28-pre1.tar.xz $ sha256sum mc-4.8.28-pre1.tar.xz e6b0423e47225e78fb59968cc45c0b004676a17ab45d7f304a091121326bfb77 mc-4.8.28-pre1.tar.xz I've built this tarball out of the latest master with translations from Transifex pulled in on a fresh Fedora 35 VM, which I'm also going to use to build the final release in about a week from now if nothing serious comes up. Many thanks! -- Sincerely yours, Yury V. Zaytsev ___ mc-devel mailing list https://mail.gnome.org/mailman/listinfo/mc-devel