Skip to content

Commit

Permalink
Master_info_index assumed that file descriptor can never be 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Golubchik committed Jan 24, 2015
1 parent 45ff0d6 commit 267fc6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/rpl_mi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -864,14 +864,15 @@ Master_info_index::Master_info_index()
memcpy(index_file_name + dir_length, "multi-", 6);

bzero((char*) &index_file, sizeof(index_file));
index_file.file= -1;
}

Master_info_index::~Master_info_index()
{
/* This will close connection for all objects in the cache */
my_hash_free(&master_info_hash);
end_io_cache(&index_file);
if (index_file.file > 0)
if (index_file.file >= 0)
my_close(index_file.file, MYF(MY_WME));
}

Expand Down

0 comments on commit 267fc6f

Please sign in to comment.