diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index be0af5c2a..5d95d4618 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.22 - ================================ + Export dm_create_dir (was create_dir) to help fix LVM2 link error Don't log mkdir fail-with-EROFS, to make create_dir equiv to the one in LVM2 Introduce and use log_sys_* macros from LVM2 dm_fclose: new function diff --git a/libdm/.exported_symbols b/libdm/.exported_symbols index dec701a68..84db9f448 100644 --- a/libdm/.exported_symbols +++ b/libdm/.exported_symbols @@ -1,6 +1,7 @@ dm_lib_release dm_lib_exit dm_driver_version +dm_create_dir dm_fclose dm_get_library_version dm_log diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index b7f661ff6..6fd7eeca3 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -225,7 +225,7 @@ static int _create_control(const char *control, uint32_t major, uint32_t minor) return 0; old_umask = umask(0022); - ret = create_dir(dm_dir()); + ret = dm_create_dir(dm_dir()); umask(old_umask); if (!ret) diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index d9b06d3bb..058af8f0a 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -628,6 +628,12 @@ char *dm_basename(const char *path); * file/stream manipulation **************************/ +/* + * Create a directory (with parent directories if necessary). + * Returns 1 on success, 0 on failure. + */ +int dm_create_dir(const char *dir); + /* * Close a stream, with nicer error checking than fclose's. * Derived from gnulib's close-stream.c. diff --git a/libdm/libdm-file.c b/libdm/libdm-file.c index bff722a5b..c61cb565f 100644 --- a/libdm/libdm-file.c +++ b/libdm/libdm-file.c @@ -55,7 +55,7 @@ out: return r; } -int create_dir(const char *dir) +int dm_create_dir(const char *dir) { struct stat info;