Skip to content
Snippets Groups Projects
Commit 79aad2e0 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Fixed fd leakage.

Rev: src/modules/Mysql/mysql.c:1.28
parent 296c0212
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: mysql.c,v 1.27 1999/09/25 23:51:36 grubba Exp $ * $Id: mysql.c,v 1.28 1999/10/19 21:01:37 grubba Exp $
* *
* SQL database functionality for Pike * SQL database functionality for Pike
* *
...@@ -79,7 +79,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; ...@@ -79,7 +79,7 @@ typedef struct dynamic_buffer_s dynamic_buffer;
* Globals * Globals
*/ */
RCSID("$Id: mysql.c,v 1.27 1999/09/25 23:51:36 grubba Exp $"); RCSID("$Id: mysql.c,v 1.28 1999/10/19 21:01:37 grubba Exp $");
/* /*
**! module Mysql **! module Mysql
...@@ -91,7 +91,7 @@ RCSID("$Id: mysql.c,v 1.27 1999/09/25 23:51:36 grubba Exp $"); ...@@ -91,7 +91,7 @@ RCSID("$Id: mysql.c,v 1.27 1999/09/25 23:51:36 grubba Exp $");
**! see also: Mysql.mysql, Mysql.result, Sql.sql **! see also: Mysql.mysql, Mysql.result, Sql.sql
**! **!
**! note **! note
**! $Id: mysql.c,v 1.27 1999/09/25 23:51:36 grubba Exp $ **! $Id: mysql.c,v 1.28 1999/10/19 21:01:37 grubba Exp $
**! **!
**! class mysql **! class mysql
**! **!
...@@ -288,6 +288,12 @@ static void pike_mysql_reconnect(void) ...@@ -288,6 +288,12 @@ static void pike_mysql_reconnect(void)
"%s\n", "%s\n",
mysql_error(&PIKE_MYSQL->mysql)); mysql_error(&PIKE_MYSQL->mysql));
} }
if (socket->net.fd >= 0) {
/* Make sure the fd gets closed on exec. */
set_close_on_exec(socket->net.fd, 1);
}
if (database) { if (database) {
int tmp; int tmp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment