Fossil

Check-in [bd600901]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improvements to detections and attempted mitigation of the file-descriptor 2 not open problem sometimes seen with stunnel4.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:bd60090134eead7237be4e9d409be2ece0b80e42
User & Date: drh 2015-02-07 19:48:10
Context
2015-02-07
19:52
Off-by-one error in the previous commit. check-in: 478ef4ca user: drh tags: trunk
19:48
Improvements to detections and attempted mitigation of the file-descriptor 2 not open problem sometimes seen with stunnel4. check-in: bd600901 user: drh tags: trunk
17:55
A couple more link fixes on the download page. check-in: 2a7c0282 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

689
690
691
692
693
694
695
696
697

698
699
700
701
702
703
704
      g.argv = zNewArgv;
    }
    zCmdName = g.argv[1];
  }
#ifndef _WIN32
  /* Make sure open() will not return file descriptor 2. */
  { int nTry = 0;
    while( !is_valid_fd(2) && nTry++ < 2 ){
      open("/dev/null", O_WRONLY);

    }
  }
#endif
  rc = name_search(zCmdName, aCommand, count(aCommand), FOSSIL_FIRST_CMD, &idx);
  if( rc==1 ){
#ifdef FOSSIL_ENABLE_TH1_HOOKS
    if( !g.isHTTP && !g.fNoThHook ){







|
|
>







689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
      g.argv = zNewArgv;
    }
    zCmdName = g.argv[1];
  }
#ifndef _WIN32
  /* Make sure open() will not return file descriptor 2. */
  { int nTry = 0;
    while( !is_valid_fd(2) && nTry++ < 2 && open("/dev/null",O_WRONLY)>0 ){}
    if( !is_valid_fd(2) ){
      fossil_fatal("file descriptor 2 is not open");
    }
  }
#endif
  rc = name_search(zCmdName, aCommand, count(aCommand), FOSSIL_FIRST_CMD, &idx);
  if( rc==1 ){
#ifdef FOSSIL_ENABLE_TH1_HOOKS
    if( !g.isHTTP && !g.fNoThHook ){