Skip to content

Commit 4b3dcfd

Browse files
authored
Remove unneeded share.h from sample code in errno documentation
1 parent f2eb5d0 commit 4b3dcfd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/c-runtime-library/reference/get-errno.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,17 @@ By default, this function's global state is scoped to the application. To change
4444
#include <errno.h>
4545
#include <fcntl.h>
4646
#include <io.h>
47-
#include <share.h>
4847
#include <stdio.h>
4948
#include <sys/stat.h>
5049

5150
int main()
5251
{
5352
errno_t err;
5453
int pfh;
55-
_sopen_s( &pfh, "nonexistent.file", _O_WRONLY, _SH_DENYNO, _S_IWRITE );
56-
_get_errno( &err );
57-
printf( "errno = %d\n", err );
58-
printf( "fyi, ENOENT = %d\n", ENOENT );
54+
_sopen_s(&pfh, "nonexistent.file", _O_WRONLY, _SH_DENYNO, _S_IWRITE);
55+
_get_errno(&err);
56+
printf("errno = %d\n", err);
57+
printf("fyi, ENOENT = %d\n", ENOENT);
5958
}
6059
```
6160

0 commit comments

Comments
 (0)