~alan-griffiths/mir/fix-1654023

« back to all changes in this revision

Viewing changes to src/common/sharedlibrary/shared_library_prober.cpp

  • Committer: Daniel van Vugt
  • Date: 2015-04-28 07:54:10 UTC
  • mfrom: (2517 development-branch)
  • mto: This revision was merged to the branch mainline in revision 2673.
  • Revision ID: daniel.van.vugt@canonical.com-20150428075410-rwskshfuar7voesp
Merge latest trunk and fix conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    }
38
38
    return std::error_code{};
39
39
}
 
40
 
 
41
// Libraries can be of the form libname.so(.X.Y)
 
42
bool path_has_library_extension(boost::filesystem::path const& path)
 
43
{
 
44
    return path.extension().string() == ".so" ||
 
45
           path.string().find(".so.") != std::string::npos;
 
46
}
 
47
 
40
48
}
41
49
 
42
50
std::vector<std::shared_ptr<mir::SharedLibrary>>
57
65
    std::vector<std::shared_ptr<mir::SharedLibrary>> libraries;
58
66
    for (; iterator != boost::filesystem::directory_iterator() ; ++iterator)
59
67
    {
60
 
        if (iterator->path().extension().string() == ".so")
 
68
        if (path_has_library_extension(iterator->path()))
61
69
        {
62
70
            try
63
71
            {