summaryrefslogtreecommitdiff
path: root/mysys/my_lib.c
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-16 12:12:26 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-16 12:12:26 +0300
commitaf912664989e0c3ee9cdb6caf8ec439029e7405c (patch)
tree9ab694ec5d18e0ab998eb4f52ee86129e5fbd3ae /mysys/my_lib.c
parent5679a2b6b342abc9d80bcf784a1a35f240be9d87 (diff)
parent6577a7a8f20538df80b851698e21095311aae190 (diff)
downloadmariadb-git-af912664989e0c3ee9cdb6caf8ec439029e7405c.tar.gz
Merge 10.3 into 10.4
In main.index_merge_myisam we remove the test that was added in commit a2d24def8cc42d27c72d833abfb39ef24a2b96ba because it duplicates the test case that was added in commit 5af12e463549e4bbc2ce6ab720d78937d5e5db4e.
Diffstat (limited to 'mysys/my_lib.c')
-rw-r--r--mysys/my_lib.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 8715c4a3333..b61a02449bc 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2008, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -109,7 +110,7 @@ static char *directory_file_name (char * dst, const char *src)
MY_DIR *my_dir(const char *path, myf MyFlags)
{
- MY_DIR_HANDLE *dirh= 0;
+ MY_DIR_HANDLE *dirh;
FILEINFO finfo;
DIR *dirp;
struct dirent *dp;
@@ -122,10 +123,13 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
tmp_file= directory_file_name(tmp_path, path);
if (!(dirp= opendir(tmp_path)))
- goto error;
+ {
+ my_errno= errno;
+ goto err_open;
+ }
if (!(dirh= my_malloc(sizeof(*dirh), MyFlags | MY_ZEROFILL)))
- goto error;
+ goto err_alloc;
if (my_init_dynamic_array(&dirh->array, sizeof(FILEINFO),
ENTRIES_START_SIZE, ENTRIES_INCREMENT,
@@ -179,11 +183,11 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
DBUG_RETURN(&dirh->dir);
- error:
- my_errno=errno;
- if (dirp)
- (void) closedir(dirp);
+error:
my_dirend(&dirh->dir);
+err_alloc:
+ (void) closedir(dirp);
+err_open:
if (MyFlags & (MY_FAE | MY_WME))
my_error(EE_DIR, MYF(ME_BELL), path, my_errno);
DBUG_RETURN(NULL);