Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: link consumers of libclient with libcommon #13394

Merged
merged 2 commits into from Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Expand Up @@ -886,7 +886,7 @@ if(WITH_LIBCEPHFS)
add_subdirectory(client)
set(libcephfs_srcs libcephfs.cc)
add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs})
target_link_libraries(cephfs LINK_PRIVATE client
target_link_libraries(cephfs LINK_PRIVATE client ceph-common
${CRYPTO_LIBS} ${EXTRALIBS})
if(ENABLE_SHARED)
foreach(name ceph-common client osdc)
Expand All @@ -906,7 +906,7 @@ if(WITH_LIBCEPHFS)
ceph_syn.cc
client/SyntheticClient.cc)
add_executable(ceph-syn ${ceph_syn_srcs})
target_link_libraries(ceph-syn client global-static)
target_link_libraries(ceph-syn client global-static common)

set(mount_ceph_srcs
mount/mount.ceph.c)
Expand All @@ -926,7 +926,7 @@ if(WITH_LIBCEPHFS)
client/fuse_ll.cc)
add_executable(ceph-fuse ${ceph_fuse_srcs})
target_link_libraries(ceph-fuse ${ALLOC_LIBS} ${FUSE_LIBRARIES}
client global-static)
client common global-static)
set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}")
install(TARGETS ceph-fuse DESTINATION bin)
install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR})
Expand Down
14 changes: 7 additions & 7 deletions src/ceph_fuse.cc
Expand Up @@ -47,18 +47,18 @@ using namespace std;

static void fuse_usage()
{
const char **argv = (const char **) malloc((2) * sizeof(char *));
argv[0] = "ceph-fuse";
argv[1] = "-h";
const char* argv[] = {
"ceph-fuse",
"-h",
};
struct fuse_args args = FUSE_ARGS_INIT(2, (char**)argv);
if (fuse_parse_cmdline(&args, NULL, NULL, NULL) == -1) {
derr << "fuse_parse_cmdline failed." << dendl;
fuse_opt_free_args(&args);
}

assert(args.allocated); // Checking fuse has realloc'd args so we can free newargv
free(argv);
assert(args.allocated);
fuse_opt_free_args(&args);
}

void usage()
{
cout <<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be its own separate PR? Seems unrelated to the linking changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the PR tries to fix the mem leak issues reported by valgrind, that's why i think this cleanup could be part of it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. That's probably worth a mention in the commit message?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Of course the tracker mentions them. Sorry @tchaikov

Expand Down
2 changes: 1 addition & 1 deletion src/client/CMakeLists.txt
Expand Up @@ -8,4 +8,4 @@ set(libclient_srcs
Trace.cc
posix_acl.cc)
add_library(client STATIC ${libclient_srcs})
target_link_libraries(client ceph-common osdc)
target_link_libraries(client osdc)