Fossil SCM
Put the output into CGI or inetd mode prior to failing with a "file-descriptor 2 not open" error.
Commit
35ab16bc9e0f33154a1a7464a8edf3c85e11fd5b
Parent
478ef4ca5a4fc9e…
1 file changed
+3
+3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -693,10 +693,13 @@ | ||
| 693 | 693 | #ifndef _WIN32 |
| 694 | 694 | /* Make sure open() will not return file descriptor 2. */ |
| 695 | 695 | { int nTry = 0; |
| 696 | 696 | while( !is_valid_fd(2) && nTry++ < 2 && open("/dev/null",O_WRONLY)>=0 ){} |
| 697 | 697 | if( !is_valid_fd(2) ){ |
| 698 | + g.cgiOutput = 1; | |
| 699 | + g.httpOut = stdout; | |
| 700 | + g.fullHttpReply = !g.isHTTP; | |
| 698 | 701 | fossil_fatal("file descriptor 2 is not open"); |
| 699 | 702 | } |
| 700 | 703 | } |
| 701 | 704 | #endif |
| 702 | 705 | rc = name_search(zCmdName, aCommand, count(aCommand), FOSSIL_FIRST_CMD, &idx); |
| 703 | 706 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -693,10 +693,13 @@ | |
| 693 | #ifndef _WIN32 |
| 694 | /* Make sure open() will not return file descriptor 2. */ |
| 695 | { int nTry = 0; |
| 696 | while( !is_valid_fd(2) && nTry++ < 2 && open("/dev/null",O_WRONLY)>=0 ){} |
| 697 | if( !is_valid_fd(2) ){ |
| 698 | fossil_fatal("file descriptor 2 is not open"); |
| 699 | } |
| 700 | } |
| 701 | #endif |
| 702 | rc = name_search(zCmdName, aCommand, count(aCommand), FOSSIL_FIRST_CMD, &idx); |
| 703 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -693,10 +693,13 @@ | |
| 693 | #ifndef _WIN32 |
| 694 | /* Make sure open() will not return file descriptor 2. */ |
| 695 | { int nTry = 0; |
| 696 | while( !is_valid_fd(2) && nTry++ < 2 && open("/dev/null",O_WRONLY)>=0 ){} |
| 697 | if( !is_valid_fd(2) ){ |
| 698 | g.cgiOutput = 1; |
| 699 | g.httpOut = stdout; |
| 700 | g.fullHttpReply = !g.isHTTP; |
| 701 | fossil_fatal("file descriptor 2 is not open"); |
| 702 | } |
| 703 | } |
| 704 | #endif |
| 705 | rc = name_search(zCmdName, aCommand, count(aCommand), FOSSIL_FIRST_CMD, &idx); |
| 706 |