diff options
author | unknown <monty@mysql.com> | 2004-06-02 00:09:14 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-06-02 00:09:14 +0300 |
commit | b5e974ff10e6d0d6aaf18094d84dedc323fada85 (patch) | |
tree | 7c47751643d7b2719fbee614235acaf2653f1d2a /innobase/os | |
parent | bcbaa6a6f2b8b5b57e53172e7ecc7e5098b53f9e (diff) | |
parent | ac298cdd8bf0e1355f83f89947e00e5173a59f41 (diff) | |
download | mariadb-git-b5e974ff10e6d0d6aaf18094d84dedc323fada85.tar.gz |
Merge with 4.0 to get fixes for netware
client/mysqltest.c:
Auto merged
include/mysql.h:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/include/row0mysql.h:
Auto merged
innobase/lock/lock0lock.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/README:
Auto merged
mysql-test/r/select_found.result:
Auto merged
mysql-test/t/select_found.test:
Auto merged
mysys/mf_wcomp.c:
Auto merged
mysys/mf_wfile.c:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_base.cc:
Auto merged
configure.in:
Get changes for netware
include/my_sys.h:
Use local file
innobase/include/os0file.h:
auto merge
innobase/os/os0file.c:
auto merge
sql/mysqld.cc:
auto merge
sql/sql_acl.cc:
indentation change
sql/sql_acl.h:
use local file
sql/sql_class.h:
auto merge
sql/sql_db.cc:
use local file
sql/sql_parse.cc:
use local file
sql/sql_select.cc:
Merge
sql/sql_show.cc:
use local file
Diffstat (limited to 'innobase/os')
-rw-r--r-- | innobase/os/os0file.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 9d428c283a5..6aca90885a6 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -311,14 +311,11 @@ os_file_handle_error( /*=================*/ /* out: TRUE if we should retry the operation */ - os_file_t file, /* in: file pointer */ const char* name, /* in: name of a file or NULL */ const char* operation)/* in: operation */ { ulint err; - UT_NOT_USED(file); - err = os_file_get_last_error(FALSE); if (err == OS_FILE_DISK_FULL) { @@ -482,6 +479,25 @@ os_io_init_simple(void) } /*************************************************************************** +Creates a temporary file. In case of error, causes abnormal termination. */ + +FILE* +os_file_create_tmpfile(void) +/*========================*/ + /* out: temporary file handle (never NULL) */ +{ + FILE* file = tmpfile(); + if (file == NULL) { + ut_print_timestamp(stderr); + fputs(" InnoDB: Error: unable to create temporary file\n", + stderr); + os_file_handle_error(NULL, "tmpfile"); + ut_error; + } + return(file); +} + +/*************************************************************************** The os_file_opendir() function opens a directory stream corresponding to the directory named by the dirname argument. The directory stream is positioned at the first entry. In both Unix and Windows we automatically skip the '.' @@ -809,7 +825,7 @@ try_again: if (file == INVALID_HANDLE_VALUE) { *success = FALSE; - retry = os_file_handle_error(file, name, + retry = os_file_handle_error(name, create_mode == OS_FILE_OPEN ? "open" : "create"); if (retry) { @@ -859,7 +875,7 @@ try_again: if (file == -1) { *success = FALSE; - retry = os_file_handle_error(file, name, + retry = os_file_handle_error(name, create_mode == OS_FILE_OPEN ? "open" : "create"); if (retry) { @@ -1101,7 +1117,7 @@ try_again: if (file == INVALID_HANDLE_VALUE) { *success = FALSE; - retry = os_file_handle_error(file, name, + retry = os_file_handle_error(name, create_mode == OS_FILE_CREATE ? "create" : "open"); if (retry) { @@ -1186,7 +1202,7 @@ try_again: if (file == -1) { *success = FALSE; - retry = os_file_handle_error(file, name, + retry = os_file_handle_error(name, create_mode == OS_FILE_CREATE ? "create" : "open"); if (retry) { @@ -1389,7 +1405,7 @@ os_file_close( return(TRUE); } - os_file_handle_error(file, NULL, "close"); + os_file_handle_error(NULL, "close"); return(FALSE); #else @@ -1398,7 +1414,7 @@ os_file_close( ret = close(file); if (ret == -1) { - os_file_handle_error(file, NULL, "close"); + os_file_handle_error(NULL, "close"); return(FALSE); } @@ -1651,7 +1667,7 @@ os_file_flush( return(TRUE); } - os_file_handle_error(file, NULL, "flush"); + os_file_handle_error(NULL, "flush"); /* It is a fatal error if a file flush does not succeed, because then the database can get corrupt on disk */ @@ -1686,7 +1702,7 @@ os_file_flush( fprintf(stderr, " InnoDB: Error: the OS said file flush did not succeed\n"); - os_file_handle_error(file, NULL, "flush"); + os_file_handle_error(NULL, "flush"); /* It is a fatal error if a file flush does not succeed, because then the database can get corrupt on disk */ @@ -1946,7 +1962,7 @@ try_again: #ifdef __WIN__ error_handling: #endif - retry = os_file_handle_error(file, NULL, "read"); + retry = os_file_handle_error(NULL, "read"); if (retry) { goto try_again; @@ -3157,7 +3173,7 @@ try_again: os_aio_array_free_slot(array, slot); - retry = os_file_handle_error(file, name, + retry = os_file_handle_error(name, type == OS_FILE_READ ? "aio read" : "aio write"); if (retry) { @@ -3257,7 +3273,7 @@ os_aio_windows_handle( ut_a(TRUE == os_file_flush(slot->file)); } } else { - os_file_handle_error(slot->file, slot->name, "Windows aio"); + os_file_handle_error(slot->name, "Windows aio"); ret_val = FALSE; } |