locked
locking example incorrect? RRS feed

  • Question

  • In the helpfile, _locking function has an example which includes the line;

       /* Quit if can't open file or system doesn't
        * support sharing.
        */
       _sopen_s( "crt_locking.txt", _O_RDONLY, _SH_DENYNO,
                 _S_IREAD | _S_IWRITE, &fh );
       if( fh == -1 )
          exit( 1 );


    The order of parameters in _sopen_s is surely incorrect, and inconsistent with io.h and the _sopen_s documentation, since &fh should be the first parameter?
    Friday, May 13, 2005 9:33 PM

Answers

  • Thanks for reporting this, xanadu1963.  I checked the current version of the code sample, and it shows the &fh as the first parameter, so when VS 2005 ships this will be correct.

    Monday, May 16, 2005 6:04 PM