Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
fe13d2fa
Commit
fe13d2fa
authored
Apr 26, 2002
by
rswindell
Browse files
Another attempt at fixing the fdopen mode conversion in fnopen().
parent
60717527
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/sbbs3/nopen.c
src/sbbs3/nopen.c
+8
-7
No files found.
src/sbbs3/nopen.c
View file @
fe13d2fa
...
...
@@ -69,11 +69,12 @@ FILE* DLLCALL fnopen(int *fd, char *str, int access)
char
mode
[
128
];
int
file
;
FILE
*
stream
;
#if 0
if(access&O_CREAT && access&O_WRONLY) { /* not compatible with fdopen */
access&=~O_WRONLY;
access|=O_RDWR;
}
#endif
if
((
file
=
nopen
(
str
,
access
))
==-
1
)
return
(
NULL
);
...
...
@@ -81,17 +82,17 @@ FILE* DLLCALL fnopen(int *fd, char *str, int access)
*
fd
=
file
;
if
(
access
&
O_APPEND
)
{
if
(
access
&
O_RD
ONLY
)
if
(
access
&
O_RD
WR
)
strcpy
(
mode
,
"a+"
);
else
strcpy
(
mode
,
"a"
);
}
else
if
(
access
&
O_CREAT
)
{
if
(
access
&
O_TRUNC
)
strcpy
(
mode
,
"w"
);
else
}
else
if
(
access
&
O_TRUNC
)
{
if
(
access
&
O_RDWR
)
strcpy
(
mode
,
"w+"
);
else
strcpy
(
mode
,
"w"
);
}
else
{
if
(
access
&
O_WRONLY
||
(
access
&
O_RDWR
)
==
O_RDWR
)
if
(
access
&
(
O_RDWR
|
O_WRONLY
)
)
strcpy
(
mode
,
"r+"
);
else
strcpy
(
mode
,
"r"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment