[bug #63157] Unlink temporary files.

2022-10-05 Thread Dmitry Goncharov
Follow-up Comment #13, bug #63157 (project make): Thank you, Eli. ___ Reply to this item at: ___ Message sent via Savannah https://savannah.gnu.org/

[bug #63157] Unlink temporary files.

2022-10-05 Thread Eli Zaretskii
Follow-up Comment #12, bug #63157 (project make): Thanks, the diffs look good (although I didn't actually test them). ___ Reply to this item at: ___

[bug #63157] Unlink temporary files.

2022-10-05 Thread Dmitry Goncharov
Follow-up Comment #11, bug #63157 (project make): > If temp_stdin is fclosed, then there's no need to call close on its fileno. Right. We have to take care of the critical section between fopen and fclose. The reasoning is the following. 1. The patch works on unices. 2. On windows the patch

[bug #63157] Unlink temporary files.

2022-10-05 Thread Eli Zaretskii
Follow-up Comment #10, bug #63157 (project make): If temp_stdin is fclosed, then there's no need to call close on its fileno. I don't think I follow your reasoning. Could you tell more details, including pointers to the source code? What do you mean by "We won't be able to use fclose, which is

[bug #63157] Unlink temporary files.

2022-10-05 Thread Dmitry Goncharov
Follow-up Comment #7, bug #63157 (project make): close is async signal safe and we call close before unlink. Should make also calls close before unlink in all other places where make unlinks this (or any other) file? ___ Reply to this

[bug #63157] Unlink temporary files.

2022-10-05 Thread Dmitry Goncharov
Follow-up Comment #9, bug #63157 (project make): In the case of temp_stdin eval_makefile fcloses this file. We'll need to store temp_stdin_fileno in a file scope variable (next to stdin_offset) and pass it to close in temp_stdin_unlink. We won't be able to use fclose, which is okay, since make is

[bug #63157] Unlink temporary files.

2022-10-05 Thread Eli Zaretskii
Follow-up Comment #6, bug #63157 (project make): > If the file is opened at the time of unlink, only file's name is removed from the directory and the file itself stays. When make exits the last reference to the file is gone and the file is deleted. That's what happens on Unix. On Windows, the

[bug #63157] Unlink temporary files.

2022-10-05 Thread Dmitry Goncharov
Follow-up Comment #8, bug #63157 (project make): we *can* call close before unlink ___ Reply to this item at: ___ Message sent via Savannah

[bug #63157] Unlink temporary files.

2022-10-05 Thread Dmitry Goncharov
Follow-up Comment #5, bug #63157 (project make): > This should be tested on MS-Windows. A file can only be deleted on MS-Windows if it isn't open by any program, and the patch (AFAICT) doesn't make sure the files are closed before unlinking them. I'm especially worried about the

Re: .SECONDARY unexpectedly affects rule invocation

2022-10-05 Thread Mikhail
I will reconsider usage of .SECONDARY in my applications and that should work. Hope this thread highlighted a case worth considering for make devs. Thanks, Mikhail On 05.10.2022 10:51, Dmitry Goncharov wrote: On Tuesday, October 4, 2022, Mikhail Pomaznoy wrote: Martin's snippet

[bug #63157] Unlink temporary files.

2022-10-05 Thread Eli Zaretskii
Follow-up Comment #4, bug #63157 (project make): This should be tested on MS-Windows. A file can only be deleted on MS-Windows if it isn't open by any program, and the patch (AFAICT) doesn't make sure the files are closed before unlinking them. I'm especially worried about the temp_stdin_unlink