The names are too generic and it makes problems in static libraries.
Addresses: https://gitlab.com/cryptsetup/cryptsetup/-/issues/623
Signed-off-by: Karel Zak <kzak@redhat.com>
extern int dup_fd_cloexec(int oldfd, int lowfd);
extern unsigned int get_fd_tabsize(void);
-extern int mkdir_p(const char *path, mode_t mode);
+extern int ul_mkdir_p(const char *path, mode_t mode);
extern char *stripoff_last_component(char *path);
/* This is readdir()-like function, but skips "." and ".." directory entries */
#endif /* __linux__ */
#ifndef HAVE_CLOSE_RANGE
-extern void close_all_fds(unsigned int first, unsigned int last);
+extern void ul_close_all_fds(unsigned int first, unsigned int last);
#endif
#define UL_COPY_READ_ERROR (-1)
}
#ifndef HAVE_CLOSE_RANGE
-void close_all_fds(unsigned int first, unsigned int last)
+void ul_close_all_fds(unsigned int first, unsigned int last)
{
struct dirent *d;
DIR *dir;
# ifdef HAVE_CLOSE_RANGE
close_range(STDERR_FILENO + 1, ~0U);
# else
- close_all_fds(STDERR_FILENO + 1, ~0U);
+ ul_close_all_fds(STDERR_FILENO + 1, ~0U);
# endif
} else if (strcmp(argv[1], "--copy-file") == 0) {
int ret = ul_copy_file(STDIN_FILENO, STDOUT_FILENO);
#endif
-int mkdir_p(const char *path, mode_t mode)
+int ul_mkdir_p(const char *path, mode_t mode)
{
char *p, *dir;
int rc = 0;
/* supported only for root or non-suid mount(8) */
if (!mnt_context_is_restricted(cxt)) {
- rc = mkdir_p(tgt, mode);
+ rc = ul_mkdir_p(tgt, mode);
if (rc)
DBG(CXT, ul_debug("mkdir %s failed: %m", tgt));
} else
{
int rc;
- rc = mkdir_p(argv[1], S_IRWXU |
+ rc = ul_mkdir_p(argv[1], S_IRWXU |
S_IRGRP | S_IXGRP |
S_IROTH | S_IXOTH);
if (rc)
#ifdef HAVE_CLOSE_RANGE
close_range(STDERR_FILENO + 1, ~0U);
#else
- close_all_fds(STDERR_FILENO + 1, ~0U);
+ ul_close_all_fds(STDERR_FILENO + 1, ~0U);
#endif
}