chiark / gitweb /
uslip: Don't let gobblers leak file descriptors.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 20 Dec 2008 11:39:32 +0000 (11:39 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 20 Dec 2008 11:39:32 +0000 (11:39 +0000)
The otherwise aptly-named gobbler_close function neglected to actually
close its file descriptor.

uslip/uslip.c

index eb60eb6..245f1ec 100644 (file)
@@ -193,7 +193,7 @@ static void destroy_pkq(pkq *q)
  */
 
 static void gobbler_close(gobbler *g)
-  { if (g->f.fd != -1) { sel_rmfile(&g->f); g->f.fd = -1; } }
+  { if (g->f.fd != -1) { sel_rmfile(&g->f); close(g->f.fd); g->f.fd = -1; } }
 
 static void gobbler_destroy(gobbler *g) { gobbler_close(g); DESTROY(g); }