mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 00:38:31 +00:00
Fix Redbean when file is read-only (#365)
This commit is contained in:
parent
22409b2b5e
commit
38112aeb20
2 changed files with 17 additions and 4 deletions
|
@ -6884,8 +6884,8 @@ static void RestoreApe(void) {
|
|||
if (endswith(zpath, ".com.dbg")) return;
|
||||
if ((a = GetAssetZip("/.ape", 5)) && (p = LoadAsset(a, &n))) {
|
||||
close(zfd);
|
||||
zfd = OpenExecutable();
|
||||
write(zfd, p, n);
|
||||
if ((zfd = OpenExecutable()) == -1 || write(zfd, p, n) == -1)
|
||||
WARNF("(srvr) can't restore .ape");
|
||||
free(p);
|
||||
} else {
|
||||
WARNF("(srvr) /.ape not found");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue