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
emacs
emacs
Commits
5684cd6e
Commit
5684cd6e
authored
Sep 14, 1999
by
Andreas Schwab
Browse files
(Fopen_network_stream): Avoid socket decriptor leak.
parent
38a734b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
src/process.c
src/process.c
+14
-0
No files found.
src/process.c
View file @
5684cd6e
...
...
@@ -1834,6 +1834,7 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
int retry = 0;
int count = specpdl_ptr - specpdl;
int count1;
#ifdef WINDOWSNT
/* Ensure socket support is loaded if available. */
...
...
@@ -1899,6 +1900,10 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
immediate_quit = 0;
}
s = -1;
count1 = specpdl_ptr - specpdl;
record_unwind_protect (close_file_unwind, make_number (s));
for (lres = res; lres; lres = lres->ai_next)
{
s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol);
...
...
@@ -1984,6 +1989,9 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
if (s < 0)
report_file_error ("error creating socket", Fcons (name, Qnil));
count1 = specpdl_ptr - specpdl;
record_unwind_protect (close_file_unwind, make_number (s));
/* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
when connect is interrupted. So let's not let it get interrupted.
Note we do not turn off polling, because polling is only used
...
...
@@ -2017,6 +2025,9 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
goto loop;
}
/* Discard the unwind protect. */
specpdl_ptr = specpdl + count1;
close (s);
if (interrupt_input)
...
...
@@ -2030,6 +2041,9 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
immediate_quit = 0;
/* Discard the unwind protect. */
specpdl_ptr = specpdl + count1;
#ifdef POLL_FOR_INPUT
unbind_to (count, Qnil);
#endif
...
...
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