Skip to content

Commit 42a006b

Browse files
committed
add some comments regarding share
1 parent 634257b commit 42a006b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/dosfns.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ long DosRWSft(int sft_idx, size_t n, void FAR * bp, int mode)
305305
/* /// Added for SHARE - Ron Cemer */
306306
if (IsShareInstalled(FALSE) && (s->sft_shroff >= 0))
307307
{
308+
/* sft_shroff is file_table index in share */
308309
int rc = share_access_check(cu_psp, s->sft_shroff, s->sft_posit,
309310
(unsigned long)n, 1);
310311
if (rc != SUCCESS)
@@ -611,7 +612,8 @@ long DosOpenSft(char FAR * fname, unsigned flags, unsigned attrib)
611612
if (result < 0)
612613
{
613614
/* /// Added for SHARE *** CURLY BRACES ADDED ALSO!!! ***. - Ron Cemer */
614-
if (IsShareInstalled(TRUE))
615+
/* if we allocated a share slot above, but open failed, free slot */
616+
if (sftp->sft_shroff >= 0) /* SHARE installed status can't change since check above */
615617
{
616618
share_close_file(sftp->sft_shroff);
617619
sftp->sft_shroff = -1;

0 commit comments

Comments
 (0)