Commit 9c4c712b authored by marko's avatar marko

Revert the changes to os0file.c that were accidentally committed in r181:

os_file_create_tmpfile(): Replace the UNIV_HOTBACKUP specific
implementation with a run-time assertion failure.
parent f6485936
...@@ -518,36 +518,61 @@ os_file_create_tmpfile(void) ...@@ -518,36 +518,61 @@ os_file_create_tmpfile(void)
/*========================*/ /*========================*/
/* out: temporary file handle, or NULL on error */ /* out: temporary file handle, or NULL on error */
{ {
#ifdef UNIV_HOTBACKUP #ifdef __NETWARE__
ut_error;
return(NULL);
#else
# ifdef __NETWARE__
FILE* file = tmpfile(); FILE* file = tmpfile();
# else /* __NETWARE__ */ #else /* __NETWARE__ */
FILE* file = NULL; FILE* file = NULL;
int fd = innobase_mysql_tmpfile(); int fd = -1;
# ifdef UNIV_HOTBACKUP
int tries;
for (tries = 10; tries--; ) {
char* name = tempnam(fil_path_to_mysql_datadir, "ib");
if (!name) {
break;
}
fd = open(name,
# ifdef __WIN__
O_SEQUENTIAL | O_SHORT_LIVED | O_TEMPORARY |
# endif /* __WIN__ */
O_CREAT | O_EXCL | O_RDWR,
S_IREAD | S_IWRITE);
if (fd >= 0) {
# ifndef __WIN__
unlink(name);
# endif /* !__WIN__ */
free(name);
break;
}
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Warning: "
"unable to create temporary file %s, retrying\n",
name);
free(name);
}
# else /* UNIV_HOTBACKUP */
fd = innobase_mysql_tmpfile();
# endif /* UNIV_HOTBACKUP */
if (fd >= 0) { if (fd >= 0) {
file = fdopen(fd, "w+b"); file = fdopen(fd, "w+b");
} }
# endif /* __NETWARE__ */ #endif /* __NETWARE__ */
if (!file) { if (!file) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: unable to create temporary file;" " InnoDB: Error: unable to create temporary file;"
" errno: %d\n", errno); " errno: %d\n", errno);
# ifndef __NETWARE__ #ifndef __NETWARE__
if (fd >= 0) { if (fd >= 0) {
close(fd); close(fd);
} }
# endif /* !__NETWARE__ */ #endif /* !__NETWARE__ */
} }
return(file); return(file);
#endif /* UNIV_HOTBACKUP */
} }
/*************************************************************************** /***************************************************************************
......
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