Skip to content

fix: Error detection after open(2)#3831

Open
smoe wants to merge 1 commit intoLinuxCNC:2.9from
smoe:29_error_open_detect
Open

fix: Error detection after open(2)#3831
smoe wants to merge 1 commit intoLinuxCNC:2.9from
smoe:29_error_open_detect

Conversation

@smoe
Copy link
Collaborator

@smoe smoe commented Feb 25, 2026

The patch speaks for itself. I guess there was some confusion between open and fopen.

@BsAtHome
Copy link
Contributor

Why do you need to comment on why the includes are included? Isn't that obvious?

And, nice catch, that fd value bug.

@smoe
Copy link
Collaborator Author

smoe commented Feb 25, 2026

I had "man 3 open" but that failed, so I was looking for a place to direct to the right one. That is typically after the #include line. For fopen it would have been correct, so I saw some value in the ref to the manual.

@BsAtHome
Copy link
Contributor

That is "man 2 open" :-) It is a syscall/kernel function and many make the same mistake.

However, it does not, IMNSHO, mean you should add the comment. The comment is a distraction. Or do you also want to add the comment in the fcntl.h include that is pulls in pid_t, mode_t, off_t and off64_t? Or what about the S_I* macros it defines? How about the locking functions? We can add the entire header as comment? Where do you draw the line? That is the problem.

Another question is that there are probably redundant includes in the source tree. That needs to be checked too and that is a hard job to do right.

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.

2 participants