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

Make udev rules more robust #78

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
dmsetup: return non-zero on stdio I/O error
If there is an I/O error on stdout or stderr, return a non-zero status
so that udev can avoid trusting the values printed.
  • Loading branch information
DemiMarie committed Apr 3, 2022
commit 0cae9428b866e558c5199f0dd7b3e88dcd96e646
4 changes: 4 additions & 0 deletions libdm/dm-tools/dmsetup.c
Original file line number Diff line number Diff line change
Expand Up @@ -7505,5 +7505,9 @@ int main(int argc, char **argv)
if (_initial_timestamp)
dm_timestamp_destroy(_initial_timestamp);

fflush(stdout);
fflush(stderr);
if (ferror(stdout) || ferror(stderr))
return 1;
return (_switches[HELP_ARG] || _switches[VERSION_ARG]) ? 0 : ret;
}