Permalink
Browse files

close the fd in disconnect_and_raise after shutdown

  • Loading branch information...
brianmario committed Oct 30, 2012
1 parent ae6a32e commit 6d093489937bb5d9b735a1957b756e54c56a6903
Showing with 2 additions and 0 deletions.
  1. +2 −0 ext/mysql2/client.c
View
@@ -4,6 +4,7 @@
#ifndef _WIN32
#include <sys/socket.h>
#endif
#include <unistd.h>
#include "wait_for_single_fd.h"
#include "mysql_enc_name_to_ruby.h"
@@ -409,6 +410,7 @@ static VALUE disconnect_and_raise(VALUE self, VALUE error) {
/* manually close the socket for read/write
this feels dirty, but is there another way? */
shutdown(wrapper->client->net.fd, 2);
close(wrapper->client->net.fd);
rb_exc_raise(error);

0 comments on commit 6d09348

Please sign in to comment.