Skip to content

Commit 65e7fab

Browse files
authored
Merge branch 'main' into misc-coreutils
2 parents 3b994fb + b200aa9 commit 65e7fab

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.github/workflows/freebsd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
disable_annotations: true
4545
- name: Prepare, build and test
46-
uses: vmactions/[email protected].8
46+
uses: vmactions/[email protected].9
4747
with:
4848
usesh: true
4949
sync: rsync
@@ -139,7 +139,7 @@ jobs:
139139
with:
140140
disable_annotations: true
141141
- name: Prepare, build and test
142-
uses: vmactions/[email protected].8
142+
uses: vmactions/[email protected].9
143143
with:
144144
usesh: true
145145
sync: rsync

src/uu/tee/src/tee.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,12 @@ pub fn ensure_stdout_not_broken() -> Result<bool> {
443443
// POLLRDBAND is the flag used by GNU tee.
444444
let mut pfds = [PollFd::new(out.as_fd(), PollFlags::POLLRDBAND)];
445445

446-
// Then, ensure that the pipe is not broken
447-
let res = nix::poll::poll(&mut pfds, PollTimeout::NONE)?;
446+
// Then, ensure that the pipe is not broken.
447+
// Use ZERO timeout to return immediately - we just want to check the current state.
448+
let res = nix::poll::poll(&mut pfds, PollTimeout::ZERO)?;
448449

449450
if res > 0 {
450-
// poll succeeded;
451+
// poll returned with events ready - check if POLLERR is set (pipe broken)
451452
let error = pfds.iter().any(|pfd| {
452453
if let Some(revents) = pfd.revents() {
453454
revents.contains(PollFlags::POLLERR)
@@ -458,8 +459,8 @@ pub fn ensure_stdout_not_broken() -> Result<bool> {
458459
return Ok(!error);
459460
}
460461

461-
// if res == 0, it means that timeout was reached, which is impossible
462-
// because we set infinite timeout.
463-
// And if res < 0, the nix wrapper should have sent back an error.
464-
unreachable!();
462+
// res == 0 means no events ready (timeout reached immediately with ZERO timeout).
463+
// This means the pipe is healthy (not broken).
464+
// res < 0 would be an error, but nix returns Err in that case.
465+
Ok(true)
465466
}

util/build-gnu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ fi
9595
cd -
9696

9797
# Pass the feature flags to make, which will pass them to cargo
98-
"${MAKE}" PROFILE="${PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
98+
"${MAKE}" PROFILE="${PROFILE}" SKIP_UTILS=more CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
9999
# min test for SELinux
100100
[ "${SELINUX_ENABLED}" = 1 ] && touch g && "${PROFILE}"/stat -c%C g && rm g
101101

102102
cp "${UU_BUILD_DIR}/install" "${UU_BUILD_DIR}/ginstall" # The GNU tests rename this script before running, to avoid confusion with the make target
103103
# Create *sum binaries
104-
for sum in b2sum b3sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum; do
104+
for sum in b2sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum; do
105105
sum_path="${UU_BUILD_DIR}/${sum}"
106106
test -f "${sum_path}" || (cd ${UU_BUILD_DIR} && ln -s "hashsum" "${sum}")
107107
done

0 commit comments

Comments
 (0)