Skip to content
Permalink
Browse files
innodb: os_file_create_tmpfile always called with NULL -> simplify
  • Loading branch information
grooverdan committed Mar 15, 2018
1 parent 7fb03d7 commit 7bb661c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
@@ -1109,7 +1109,7 @@ dict_init(void)
dict_operation_lock, SYNC_DICT_OPERATION);

if (!srv_read_only_mode) {
dict_foreign_err_file = os_file_create_tmpfile(NULL);
dict_foreign_err_file = os_file_create_tmpfile();
ut_a(dict_foreign_err_file);
}

@@ -535,14 +535,11 @@ struct os_file_stat_t {
};

/** Create a temporary file. This function is like tmpfile(3), but
the temporary file is created in the given parameter path. If the path
is null then it will create the file in the mysql server configuration
the temporary file is created in the in the mysql server configuration
parameter (--tmpdir).
@param[in] path location for creating temporary file
@return temporary file handle, or NULL on error */
FILE*
os_file_create_tmpfile(
const char* path);
os_file_create_tmpfile();

/** The os_file_opendir() function opens a directory stream corresponding to the
directory named by the dirname argument. The directory stream is positioned
@@ -496,7 +496,7 @@ void lock_sys_t::create(ulint n_cells)
prdt_page_hash = hash_create(n_cells);

if (!srv_read_only_mode) {
lock_latest_err_file = os_file_create_tmpfile(NULL);
lock_latest_err_file = os_file_create_tmpfile();
ut_a(lock_latest_err_file);
}
}
@@ -1215,19 +1215,16 @@ AIO::release_with_mutex(Slot* slot)
release();
}

/** Creates a temporary file. This function is like tmpfile(3), but
the temporary file is created in the given parameter path. If the path
is NULL then it will create the file in the MySQL server configuration
/** Create a temporary file. This function is like tmpfile(3), but
the temporary file is created in the in the mysql server configuration
parameter (--tmpdir).
@param[in] path location for creating temporary file
@@return temporary file handle, or NULL on error */
@return temporary file handle, or NULL on error */
FILE*
os_file_create_tmpfile(
const char* path)
os_file_create_tmpfile()
{
FILE* file = NULL;
WAIT_ALLOW_WRITES();
int fd = innobase_mysql_tmpfile(path);
int fd = innobase_mysql_tmpfile(NULL);

if (fd >= 0) {
file = fdopen(fd, "w+b");
@@ -1754,7 +1754,7 @@ innobase_start_or_create_for_mysql()
} else {

srv_monitor_file_name = NULL;
srv_monitor_file = os_file_create_tmpfile(NULL);
srv_monitor_file = os_file_create_tmpfile();

if (!srv_monitor_file && err == DB_SUCCESS) {
err = DB_ERROR;
@@ -1764,7 +1764,7 @@ innobase_start_or_create_for_mysql()
mutex_create(LATCH_ID_SRV_MISC_TMPFILE,
&srv_misc_tmpfile_mutex);

srv_misc_tmpfile = os_file_create_tmpfile(NULL);
srv_misc_tmpfile = os_file_create_tmpfile();

if (!srv_misc_tmpfile && err == DB_SUCCESS) {
err = DB_ERROR;

0 comments on commit 7bb661c

Please sign in to comment.