Fossil SCM
Off-by-one error in the previous commit.
Commit
478ef4ca5a4fc9e24160eba390a7968f261ce1b3
Parent
bd60090134eead7…
1 file changed
+1
-1
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -691,11 +691,11 @@ | ||
| 691 | 691 | zCmdName = g.argv[1]; |
| 692 | 692 | } |
| 693 | 693 | #ifndef _WIN32 |
| 694 | 694 | /* Make sure open() will not return file descriptor 2. */ |
| 695 | 695 | { int nTry = 0; |
| 696 | - while( !is_valid_fd(2) && nTry++ < 2 && open("/dev/null",O_WRONLY)>0 ){} | |
| 696 | + while( !is_valid_fd(2) && nTry++ < 2 && open("/dev/null",O_WRONLY)>=0 ){} | |
| 697 | 697 | if( !is_valid_fd(2) ){ |
| 698 | 698 | fossil_fatal("file descriptor 2 is not open"); |
| 699 | 699 | } |
| 700 | 700 | } |
| 701 | 701 | #endif |
| 702 | 702 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -691,11 +691,11 @@ | |
| 691 | zCmdName = g.argv[1]; |
| 692 | } |
| 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 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -691,11 +691,11 @@ | |
| 691 | zCmdName = g.argv[1]; |
| 692 | } |
| 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 |