Commit fca5ee0c authored by heikki@hundin.mysql.fi's avatar heikki@hundin.mysql.fi

Merge

parents 8474953c 76789a4c
...@@ -486,7 +486,7 @@ os_io_init_simple(void) ...@@ -486,7 +486,7 @@ os_io_init_simple(void)
} }
} }
#ifndef UNIV_HOTBACKUP #if !defined(UNIV_HOTBACKUP) && !defined(__NETWARE__)
/************************************************************************* /*************************************************************************
Creates a temporary file. This function is defined in ha_innodb.cc. */ Creates a temporary file. This function is defined in ha_innodb.cc. */
...@@ -494,7 +494,7 @@ int ...@@ -494,7 +494,7 @@ int
innobase_mysql_tmpfile(void); innobase_mysql_tmpfile(void);
/*========================*/ /*========================*/
/* out: temporary file descriptor, or < 0 on error */ /* out: temporary file descriptor, or < 0 on error */
#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_HOTBACKUP && !__NETWARE__ */
/*************************************************************************** /***************************************************************************
Creates a temporary file. */ Creates a temporary file. */
...@@ -504,9 +504,12 @@ os_file_create_tmpfile(void) ...@@ -504,9 +504,12 @@ os_file_create_tmpfile(void)
/*========================*/ /*========================*/
/* out: temporary file handle, or NULL on error */ /* out: temporary file handle, or NULL on error */
{ {
#ifdef __NETWARE__
FILE* file = tmpfile();
#else /* __NETWARE__ */
FILE* file = NULL; FILE* file = NULL;
int fd = -1; int fd = -1;
#ifdef UNIV_HOTBACKUP # ifdef UNIV_HOTBACKUP
int tries; int tries;
for (tries = 10; tries--; ) { for (tries = 10; tries--; ) {
char* name = tempnam(fil_path_to_mysql_datadir, "ib"); char* name = tempnam(fil_path_to_mysql_datadir, "ib");
...@@ -515,15 +518,15 @@ os_file_create_tmpfile(void) ...@@ -515,15 +518,15 @@ os_file_create_tmpfile(void)
} }
fd = open(name, fd = open(name,
# ifdef __WIN__ # ifdef __WIN__
O_SEQUENTIAL | O_SHORT_LIVED | O_TEMPORARY | O_SEQUENTIAL | O_SHORT_LIVED | O_TEMPORARY |
# endif /* __WIN__ */ # endif /* __WIN__ */
O_CREAT | O_EXCL | O_RDWR, O_CREAT | O_EXCL | O_RDWR,
S_IREAD | S_IWRITE); S_IREAD | S_IWRITE);
if (fd >= 0) { if (fd >= 0) {
# ifndef __WIN__ # ifndef __WIN__
unlink(name); unlink(name);
# endif /* !__WIN__ */ # endif /* !__WIN__ */
free(name); free(name);
break; break;
} }
...@@ -534,22 +537,25 @@ os_file_create_tmpfile(void) ...@@ -534,22 +537,25 @@ os_file_create_tmpfile(void)
name); name);
free(name); free(name);
} }
#else /* UNIV_HOTBACKUP */ # else /* UNIV_HOTBACKUP */
fd = innobase_mysql_tmpfile(); fd = innobase_mysql_tmpfile();
#endif /* UNIV_HOTBACKUP */ # endif /* UNIV_HOTBACKUP */
if (fd >= 0) { if (fd >= 0) {
file = fdopen(fd, "w+b"); file = fdopen(fd, "w+b");
} }
#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__
if (fd >= 0) { if (fd >= 0) {
close(fd); close(fd);
} }
#endif /* !__NETWARE__ */
} }
return(file); return(file);
......
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