mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-16 14:58:38 +00:00
btrfs-progs: path-utils: rename path_is_mount_point to avoid potential symbol name clash
There's a report that a static build fails when there's a static version of libudev: /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/libudev.a(path-util.o): in function `path_is_mount_point': path-util.c:(.text+0xbc0): multiple definition of `path_is_mount_point'; common/path-utils.o:path-utils.c:(.text+0x290): first defined here There's a helper path_is_mount_point in libudev too but not exported so dynamic library is fine, unlike static build. The static build of libudev is not common but we can support that with a simple rename. Issue: #611 Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
91a83034c5
commit
6ea85b680b
@ -76,7 +76,7 @@ int check_arg_type(const char *input)
|
||||
if (path_is_block_device(path) == 1)
|
||||
return BTRFS_ARG_BLKDEV;
|
||||
|
||||
if (path_is_mount_point(path) == 1)
|
||||
if (path_is_a_mount_point(path) == 1)
|
||||
return BTRFS_ARG_MNTPOINT;
|
||||
|
||||
if (path_is_reg_file(path))
|
||||
|
@ -50,10 +50,14 @@ int path_is_block_device(const char *path)
|
||||
}
|
||||
|
||||
/*
|
||||
* check if given path is a mount point
|
||||
* return 1 if yes. 0 if no. -1 for error
|
||||
* Check if given path is a mount point. (Note: a similar function also exists
|
||||
* in libudev so it's been renamed to avoid clash.)
|
||||
*
|
||||
* Return: 1 if yes,
|
||||
* 0 if no,
|
||||
* -1 for error
|
||||
*/
|
||||
int path_is_mount_point(const char *path)
|
||||
int path_is_a_mount_point(const char *path)
|
||||
{
|
||||
FILE *f;
|
||||
struct mntent *mnt;
|
||||
|
@ -32,7 +32,7 @@ char *__strncpy_null(char *dest, const char *src, size_t n);
|
||||
#define strncpy_null(dest, src) __strncpy_null(dest, src, sizeof(dest))
|
||||
|
||||
int path_is_block_device(const char *file);
|
||||
int path_is_mount_point(const char *file);
|
||||
int path_is_a_mount_point(const char *file);
|
||||
int path_exists(const char *file);
|
||||
int path_is_reg_file(const char *path);
|
||||
int path_is_dir(const char *path);
|
||||
|
Loading…
Reference in New Issue
Block a user