Fix #8: constify mkpath() and makepath()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-10-31 21:08:21 +01:00
1 parent be6f276557
commit add4d5d325
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -67,8 +67,8 @@ char *lfgetkey (lfile_t *lf, char *key);
int lfgetint (lfile_t *lf, char *key); int lfgetint (lfile_t *lf, char *key);
int fgetint (char *file, char *sep, char *key); int fgetint (char *file, char *sep, char *key);
int mkpath (char *dir, mode_t mode); int mkpath (const char *dir, mode_t mode);
int makepath (char *dir); int makepath (const char *dir);
int dir (const char *dir, const char *type, int (*filter) (const char *file), char ***list, int strip); int dir (const char *dir, const char *type, int (*filter) (const char *file), char ***list, int strip);
int rsync (char *src, char *dst, int delete, int (*filter) (const char *file)); int rsync (char *src, char *dst, int delete, int (*filter) (const char *file));
+2 -2
View File
@@ -29,7 +29,7 @@
* Returns: * Returns:
* POSIX OK(0) on success, otherwise -1 with @errno set. * POSIX OK(0) on success, otherwise -1 with @errno set.
*/ */
int mkpath(char *dir, mode_t mode) int mkpath(const char *dir, mode_t mode)
{ {
struct stat sb; struct stat sb;
@@ -56,7 +56,7 @@ int mkpath(char *dir, mode_t mode)
* fails allocating temporary memory. For other error codes see the * fails allocating temporary memory. For other error codes see the
* mkdir() syscall description. * mkdir() syscall description.
*/ */
int makepath(char *dir) int makepath(const char *dir)
{ {
return mkpath(dir, 0777); return mkpath(dir, 0777);
} }