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

illumos defines _MAX macros in limits.h #1266

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Conversation

hadfl
Copy link
Contributor

@hadfl hadfl commented Oct 12, 2024

No description provided.

@hadfl hadfl changed the title illumos defines _MAX macros in limit.h illumos defines _MAX macros in limits.h Oct 12, 2024
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.10%. Comparing base (fcc946d) to head (4cb775a).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1266      +/-   ##
==========================================
+ Coverage   51.07%   51.10%   +0.03%     
==========================================
  Files          45       45              
  Lines       18250    18251       +1     
==========================================
+ Hits         9321     9328       +7     
+ Misses       8929     8923       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@c72578 c72578 left a comment

Choose a reason for hiding this comment

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

The only _MAX in rrd_list.c is PATH_MAX. So, this commit is about missing PATH_MAX under illumos?

PATH_MAX is also required in rrd_daemon.c [1].
Therefore, could you please consider handling missing #include <limits.h> in case of __illumos__ somewhere else, more globally?
e.g. in src/rrd_config_bottom.h

#ifndef MAXPATH

[1]

git grep PATH_MAX
CHANGES:* Avoids potential unterminated string because of fixed PATH_MAX buffer
src/rrd_config_bottom.h:# ifdef PATH_MAX
src/rrd_config_bottom.h:#  define MAXPATH PATH_MAX
src/rrd_daemon.c:        if ((end_ptr - start_ptr + strlen(fullpath) + 1) >= PATH_MAX) {
src/rrd_list.c:         if (strlen(dirname) + strlen(entry->d_name) + 1 >= PATH_MAX) {

@hadfl
Copy link
Contributor Author

hadfl commented Oct 13, 2024

Thank you for your review. You are right, it's much better to put it into src/rrd_config_bottom.h.

src/rrd_config_bottom.h Outdated Show resolved Hide resolved
oetiker
oetiker previously approved these changes Oct 15, 2024
@oetiker oetiker merged commit 5041750 into oetiker:master Oct 15, 2024
6 checks passed
@oetiker
Copy link
Owner

oetiker commented Oct 15, 2024

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

Successfully merging this pull request may close these issues.

3 participants