Skip to content

Commit 7bb661c

Browse files
committed
innodb: os_file_create_tmpfile always called with NULL -> simplify
1 parent 7fb03d7 commit 7bb661c

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

storage/innobase/dict/dict0dict.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ dict_init(void)
11091109
dict_operation_lock, SYNC_DICT_OPERATION);
11101110

11111111
if (!srv_read_only_mode) {
1112-
dict_foreign_err_file = os_file_create_tmpfile(NULL);
1112+
dict_foreign_err_file = os_file_create_tmpfile();
11131113
ut_a(dict_foreign_err_file);
11141114
}
11151115

storage/innobase/include/os0file.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,14 +535,11 @@ struct os_file_stat_t {
535535
};
536536

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

547544
/** The os_file_opendir() function opens a directory stream corresponding to the
548545
directory named by the dirname argument. The directory stream is positioned

storage/innobase/lock/lock0lock.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void lock_sys_t::create(ulint n_cells)
496496
prdt_page_hash = hash_create(n_cells);
497497

498498
if (!srv_read_only_mode) {
499-
lock_latest_err_file = os_file_create_tmpfile(NULL);
499+
lock_latest_err_file = os_file_create_tmpfile();
500500
ut_a(lock_latest_err_file);
501501
}
502502
}

storage/innobase/os/os0file.cc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,19 +1215,16 @@ AIO::release_with_mutex(Slot* slot)
12151215
release();
12161216
}
12171217

1218-
/** Creates a temporary file. This function is like tmpfile(3), but
1219-
the temporary file is created in the given parameter path. If the path
1220-
is NULL then it will create the file in the MySQL server configuration
1218+
/** Create a temporary file. This function is like tmpfile(3), but
1219+
the temporary file is created in the in the mysql server configuration
12211220
parameter (--tmpdir).
1222-
@param[in] path location for creating temporary file
1223-
@@return temporary file handle, or NULL on error */
1221+
@return temporary file handle, or NULL on error */
12241222
FILE*
1225-
os_file_create_tmpfile(
1226-
const char* path)
1223+
os_file_create_tmpfile()
12271224
{
12281225
FILE* file = NULL;
12291226
WAIT_ALLOW_WRITES();
1230-
int fd = innobase_mysql_tmpfile(path);
1227+
int fd = innobase_mysql_tmpfile(NULL);
12311228

12321229
if (fd >= 0) {
12331230
file = fdopen(fd, "w+b");

storage/innobase/srv/srv0start.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ innobase_start_or_create_for_mysql()
17541754
} else {
17551755

17561756
srv_monitor_file_name = NULL;
1757-
srv_monitor_file = os_file_create_tmpfile(NULL);
1757+
srv_monitor_file = os_file_create_tmpfile();
17581758

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

1767-
srv_misc_tmpfile = os_file_create_tmpfile(NULL);
1767+
srv_misc_tmpfile = os_file_create_tmpfile();
17681768

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

0 commit comments

Comments
 (0)