You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Linux, the kernel enforces ETXTBSY ("Text file busy") and refuses to
open a file for writting if that file is being executed.
The original code prior to this change used "fs::copy(...)" which opens
the destination file for writting and this was being blocked by the
ETXTBSY error.
This patch fixes the issue by copying the new binary to a temp file in
the same directory as the current executable and then uses "fs::rename"
to atomically swap the directory entry (it only updates the directory
mapping it doesn't open the file's content).
This basically mimics what is already implemented for Windows in the
update.rs module but adapted for Unix semantics.
Fixes#8468
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
0 commit comments