Commit 8f548eb1 authored by unknown's avatar unknown

os0file.c:

  Put back Monty's patch which the previous push accidentally erased: print also operation type in os_file_handle_error()


innobase/os/os0file.c:
  Put back Monty's patch which the previous push accidentally erased: print also operation type in os_file_handle_error()
parent 0ae3a4dc
...@@ -300,7 +300,8 @@ os_file_handle_error( ...@@ -300,7 +300,8 @@ os_file_handle_error(
/* out: TRUE if we should retry the /* out: TRUE if we should retry the
operation */ operation */
os_file_t file, /* in: file pointer */ os_file_t file, /* in: file pointer */
char* name) /* in: name of a file or NULL */ char* name, /* in: name of a file or NULL */
const char* operation)/* in: operation */
{ {
ulint err; ulint err;
...@@ -343,6 +344,7 @@ os_file_handle_error( ...@@ -343,6 +344,7 @@ os_file_handle_error(
fprintf(stderr, "InnoDB: File name %s\n", name); fprintf(stderr, "InnoDB: File name %s\n", name);
} }
fprintf(stderr, "InnoDB: System call %s.\n", operation);
fprintf(stderr, "InnoDB: Cannot continue operation.\n"); fprintf(stderr, "InnoDB: Cannot continue operation.\n");
fflush(stderr); fflush(stderr);
...@@ -424,8 +426,9 @@ os_file_create_simple( ...@@ -424,8 +426,9 @@ os_file_create_simple(
if (file == INVALID_HANDLE_VALUE) { if (file == INVALID_HANDLE_VALUE) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name); retry = os_file_handle_error(file, name,
create_mode == OS_FILE_OPEN ?
"open" : "create");
if (retry) { if (retry) {
goto try_again; goto try_again;
} }
...@@ -465,8 +468,9 @@ os_file_create_simple( ...@@ -465,8 +468,9 @@ os_file_create_simple(
if (file == -1) { if (file == -1) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name); retry = os_file_handle_error(file, name,
create_mode == OS_FILE_OPEN ?
"open" : "create");
if (retry) { if (retry) {
goto try_again; goto try_again;
} }
...@@ -573,8 +577,9 @@ os_file_create( ...@@ -573,8 +577,9 @@ os_file_create(
if (file == INVALID_HANDLE_VALUE) { if (file == INVALID_HANDLE_VALUE) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name); retry = os_file_handle_error(file, name,
create_mode == OS_FILE_OPEN ?
"open" : "create");
if (retry) { if (retry) {
goto try_again; goto try_again;
} }
...@@ -620,8 +625,9 @@ os_file_create( ...@@ -620,8 +625,9 @@ os_file_create(
if (file == -1) { if (file == -1) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(file, name); retry = os_file_handle_error(file, name,
create_mode == OS_FILE_OPEN ?
"open" : "create");
if (retry) { if (retry) {
goto try_again; goto try_again;
} }
...@@ -654,7 +660,7 @@ os_file_close( ...@@ -654,7 +660,7 @@ os_file_close(
return(TRUE); return(TRUE);
} }
os_file_handle_error(file, NULL); os_file_handle_error(file, NULL, "close");
return(FALSE); return(FALSE);
#else #else
int ret; int ret;
...@@ -662,7 +668,7 @@ os_file_close( ...@@ -662,7 +668,7 @@ os_file_close(
ret = close(file); ret = close(file);
if (ret == -1) { if (ret == -1) {
os_file_handle_error(file, NULL); os_file_handle_error(file, NULL, "close");
return(FALSE); return(FALSE);
} }
...@@ -830,7 +836,7 @@ os_file_flush( ...@@ -830,7 +836,7 @@ os_file_flush(
return(TRUE); return(TRUE);
} }
os_file_handle_error(file, NULL); os_file_handle_error(file, NULL, "flush");
/* It is a fatal error if a file flush does not succeed, because then /* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */ the database can get corrupt on disk */
...@@ -863,7 +869,7 @@ os_file_flush( ...@@ -863,7 +869,7 @@ os_file_flush(
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: the OS said file flush did not succeed\n"); " InnoDB: Error: the OS said file flush did not succeed\n");
os_file_handle_error(file, NULL); os_file_handle_error(file, NULL, "flush");
/* It is a fatal error if a file flush does not succeed, because then /* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */ the database can get corrupt on disk */
...@@ -1104,7 +1110,7 @@ os_file_read( ...@@ -1104,7 +1110,7 @@ os_file_read(
#ifdef __WIN__ #ifdef __WIN__
error_handling: error_handling:
#endif #endif
retry = os_file_handle_error(file, NULL); retry = os_file_handle_error(file, NULL, "read");
if (retry) { if (retry) {
goto try_again; goto try_again;
...@@ -2022,8 +2028,8 @@ os_aio( ...@@ -2022,8 +2028,8 @@ os_aio(
os_aio_array_free_slot(array, slot); os_aio_array_free_slot(array, slot);
retry = os_file_handle_error(file, name); retry = os_file_handle_error(file, name,
type == OS_FILE_READ ? "aio read" : "aio write");
if (retry) { if (retry) {
goto try_again; goto try_again;
...@@ -2121,7 +2127,7 @@ os_aio_windows_handle( ...@@ -2121,7 +2127,7 @@ os_aio_windows_handle(
ut_a(TRUE == os_file_flush(slot->file)); ut_a(TRUE == os_file_flush(slot->file));
} }
} else { } else {
os_file_handle_error(slot->file, slot->name); os_file_handle_error(slot->file, slot->name, "Windows aio");
ret_val = FALSE; ret_val = FALSE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment