Remove level parameter from mkdir_r API

It has been removed since it is of no use to the end user.
This commit is contained in:
Xavier Del Campo Romero 2020-09-17 13:07:43 +02:00
parent 019e074bde
commit 09282eefd0
2 changed files with 8 additions and 4 deletions

View File

@ -23,7 +23,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
int mkdir_r(const char *const path, int level) static int mkdir_r_lvl(const char *const path, int level)
{ {
int ret = -1; int ret = -1;
char *dir = NULL; char *dir = NULL;
@ -65,7 +65,7 @@ int mkdir_r(const char *const path, int level)
} }
if (*c) if (*c)
mkdir_r(path, cur_level); mkdir_r_lvl(path, cur_level);
/* No more levels left. */ /* No more levels left. */
ret = 0; ret = 0;
@ -79,3 +79,8 @@ exit:
return ret; return ret;
} }
int mkdir_r(const char *const path)
{
return mkdir_r_lvl(path, 0);
}

View File

@ -19,9 +19,8 @@
/** /**
* Recursive directory creation. * Recursive directory creation.
* @param path Directory path * @param path Directory path
* @param level Always set to 0.
* @return 0 if successful, -1 otherwise. * @return 0 if successful, -1 otherwise.
*/ */
int mkdir_r(const char *const path, int level); int mkdir_r(const char *const path);
#endif /* MKDIR_R_H */ #endif /* MKDIR_R_H */