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

‘struct dirent’ has no member named ‘d_namlen’ #542

Closed
lhecker opened this issue Feb 15, 2015 · 3 comments
Closed

‘struct dirent’ has no member named ‘d_namlen’ #542

lhecker opened this issue Feb 15, 2015 · 3 comments

Comments

@lhecker
Copy link

lhecker commented Feb 15, 2015

488d3a4#diff-6641255a80b4407d59eaf41c20a64b38R386 introduces a regression:
Since "d_namlen" is not specified in POSIX, this is probably not going to compile on most systems (tested on Ubuntu 14.10).

dp->d_namlen != 16 needs to be either removed or replaced with something else. AFAIK d_namlen is technically the same as strlen(dp->d_name), while strncmp(dp->d_name, msgid_str, 8) is used just after that. Therefore you could also just replace it with:

if (strlen(dp->d_name) != 16 || memcmp(dp->d_name, msgid_str, 8) != 0) {
    continue;
}

I think this should fix the issue and be about as fast or faster as the previous solution, since strncmp checks for \0 in both strings too.

@lhecker
Copy link
Author

lhecker commented Feb 15, 2015

BTW: There is another build error since SSL_CTX_use_certificate_chain got renamed to SSL_CTX_use_certificate_chain_mem, which is a function that does not exist in OpenSSL, but only LibreSSL. But I'm not sure if this is a real bug, which I should submit, or working as intended. Fact is that it's not building the project without modifying the code to match OpenSSL.

@poolpOrg
Copy link
Member

Can you open a different ticket for the openssl issue ?

I have worked on it yesterday so I'll look at it separately.

@poolpOrg
Copy link
Member

fix applied to remove d_namlen and replace it with strlen(), thanks

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

No branches or pull requests

2 participants