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

sysfs: Fix basename() build with musl #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

krzk
Copy link

@krzk krzk commented Jun 6, 2018

musl provides only standard basename() which accepts non-const string.
This fixes build error with musl C library:

| sysfs.cc: In function 'std::__cxx11::string sysfs_getbustype(const string&)':
| sysfs.cc:102:21: error: 'basename' was not declared in this scope
|        "/devices/" + basename(path.c_str());
|                      ^~~~~~~~

Signed-off-by: Krzysztof Kozlowski [email protected]

musl provides only standard basename() which accepts non-const string.
This fixes build error with musl C library:

    | sysfs.cc: In function 'std::__cxx11::string sysfs_getbustype(const string&)':
    | sysfs.cc:102:21: error: 'basename' was not declared in this scope
    |        "/devices/" + basename(path.c_str());
    |                      ^~~~~~~~

Signed-off-by: Krzysztof Kozlowski <[email protected]>
lyonel added a commit that referenced this pull request Aug 19, 2020
@BKPepe
Copy link

BKPepe commented Dec 8, 2020

@lyonel Can you take a look, please?

@benkohler
Copy link

Fixed in d3c66a6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants