mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-12 09:17:53 +00:00
Put Redbean in uniprocess mode on NT temporarily
The Windows fork() polyfill (which we implement using pure WIN32) appears to be acting strangely. It's possible a regression was introduced by recent changes that our tests didn't catch. This change is workaround so we can upload a new working binary release to the Redbean website until we can fully fix the problem. See also #90
This commit is contained in:
parent
2596a59374
commit
7e4021bf82
1 changed files with 5 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include "libc/calls/struct/itimerval.h"
|
#include "libc/calls/struct/itimerval.h"
|
||||||
#include "libc/calls/struct/stat.h"
|
#include "libc/calls/struct/stat.h"
|
||||||
#include "libc/calls/weirdtypes.h"
|
#include "libc/calls/weirdtypes.h"
|
||||||
|
#include "libc/dce.h"
|
||||||
#include "libc/fmt/conv.h"
|
#include "libc/fmt/conv.h"
|
||||||
#include "libc/fmt/fmt.h"
|
#include "libc/fmt/fmt.h"
|
||||||
#include "libc/fmt/itoa.h"
|
#include "libc/fmt/itoa.h"
|
||||||
|
@ -85,7 +86,7 @@ FLAGS\n\
|
||||||
-h help\n\
|
-h help\n\
|
||||||
-v verbosity\n\
|
-v verbosity\n\
|
||||||
-d daemonize\n\
|
-d daemonize\n\
|
||||||
-s uniprocess\n\
|
-u uniprocess\n\
|
||||||
-z print port\n\
|
-z print port\n\
|
||||||
-m log messages\n\
|
-m log messages\n\
|
||||||
-c INT cache seconds\n\
|
-c INT cache seconds\n\
|
||||||
|
@ -637,7 +638,8 @@ static bool OpenZip(const char *path) {
|
||||||
fd = -1;
|
fd = -1;
|
||||||
map = MAP_FAILED;
|
map = MAP_FAILED;
|
||||||
if ((fd = open(path, O_RDONLY)) != -1 && fstat(fd, &st) != -1 && st.st_size &&
|
if ((fd = open(path, O_RDONLY)) != -1 && fstat(fd, &st) != -1 && st.st_size &&
|
||||||
(map = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) &&
|
(map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0)) !=
|
||||||
|
MAP_FAILED &&
|
||||||
(cdir = zipfindcentraldir(map, st.st_size)) && IndexAssets(map, cdir)) {
|
(cdir = zipfindcentraldir(map, st.st_size)) && IndexAssets(map, cdir)) {
|
||||||
ok = true;
|
ok = true;
|
||||||
zmap = map;
|
zmap = map;
|
||||||
|
@ -1136,6 +1138,7 @@ static void TuneServerSocket(void) {
|
||||||
|
|
||||||
void RedBean(void) {
|
void RedBean(void) {
|
||||||
uint32_t addrsize;
|
uint32_t addrsize;
|
||||||
|
if (IsWindows()) uniprocess = true;
|
||||||
gmtoff = GetGmtOffset();
|
gmtoff = GetGmtOffset();
|
||||||
programfile = (const char *)getauxval(AT_EXECFN);
|
programfile = (const char *)getauxval(AT_EXECFN);
|
||||||
CHECK(OpenZip(programfile));
|
CHECK(OpenZip(programfile));
|
||||||
|
|
Loading…
Reference in a new issue