Skip to content

date: strip errno when write to stdout fails - #14206

Open
Devel08 wants to merge 2 commits into
uutils:mainfrom
Devel08:date-stdout-strip-errno
Open

date: strip errno when write to stdout fails#14206
Devel08 wants to merge 2 commits into
uutils:mainfrom
Devel08:date-stdout-strip-errno

Conversation

@Devel08

@Devel08 Devel08 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/retry (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)

Comment thread src/uu/date/src/date.rs

@xtqqczze xtqqczze Aug 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use thiserror crate, something like:

#[derive(Debug, Error)]
enum DateError {
    #[error("{}", translate!("date-error-write", "error" => strip_errno(.0)))]
    Write(io::Error),
}

impl UError for DateError {}

then use:

.map_err(DateError::Write)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, we can even wrap the other errors later too

@Devel08
Devel08 force-pushed the date-stdout-strip-errno branch from d7217d8 to 07c4aa2 Compare August 28, 2026 16:15
date: use thiserror

update thiserror in fuzz
@Devel08
Devel08 force-pushed the date-stdout-strip-errno branch from 602d848 to 733e3f7 Compare August 28, 2026 16:22
Comment thread src/uu/date/Cargo.toml Outdated
]

[dependencies]
thiserror = { workspace = true }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: alphabetize

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