summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbug/dbug.c7
-rw-r--r--storage/maria/unittest/ma_test_loghandler-t.c5
2 files changed, 6 insertions, 6 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c
index f956adff3f1..1e72bb348ed 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -1979,12 +1979,7 @@ static void DBUGOpenFile(CODE_STATE *cs,
else
{
newfile= !EXISTS(name);
- if (!(fp= fopen(name,
-#if defined(MSDOS) || defined(__WIN__)
- append ? "a+c" : "wc"
-#else
- append ? "a+" : "w"
-#endif
+ if (!(fp= fopen(name, append ? "a+" : "w")))
)))
{
(void) fprintf(stderr, ERR_OPEN, cs->process, name);
diff --git a/storage/maria/unittest/ma_test_loghandler-t.c b/storage/maria/unittest/ma_test_loghandler-t.c
index 7136b6be806..c5a9ccc2724 100644
--- a/storage/maria/unittest/ma_test_loghandler-t.c
+++ b/storage/maria/unittest/ma_test_loghandler-t.c
@@ -151,6 +151,11 @@ int main(int argc __attribute__((unused)), char *argv[])
MY_INIT(argv[0]);
+ if (my_set_max_open_files(100) < 100)
+ {
+ fprintf(stderr, "can't allocate 100 file descriptors\n");
+ exit(1);
+ }
bzero(&pagecache, sizeof(pagecache));
maria_data_root= (char *)".";
if (maria_log_remove())