Skip to content

Commit 62952c4

Browse files
authored
Merge branch 'main' into date_11044
2 parents 1ef2037 + 1f7c81f commit 62952c4

3 files changed

Lines changed: 9 additions & 22 deletions

File tree

src/uu/nohup/src/nohup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ fn find_stdout() -> UResult<File> {
150150
Ok(t)
151151
}
152152
Err(e1) => {
153-
let Some(home) = env::var_os("HOME") else {
153+
let Ok(home) = env::var("HOME") else {
154154
return Err(NohupError::OpenFailed(internal_failure_code, e1).into());
155155
};
156156
let mut homeout = PathBuf::from(home);
157157
homeout.push(NOHUP_OUT);
158-
let homeout_str = homeout.to_string_lossy();
158+
let homeout_str = homeout.to_str().unwrap();
159159
match OpenOptions::new().create(true).append(true).open(&homeout) {
160160
Ok(t) => {
161161
show_error!(

src/uu/touch/src/touch.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,14 +622,21 @@ fn try_futimens_via_write_fd(path: &Path, atime: FileTime, mtime: FileTime) -> s
622622
let mtime_sec = mtime.unix_seconds();
623623
let mtime_nsec = i64::from(mtime.nanoseconds());
624624

625+
#[cfg(target_pointer_width = "32")]
625626
let atime_spec = TimeSpec::new(
626627
atime_sec.try_into().unwrap(),
627628
atime_nsec.try_into().unwrap(),
628629
);
630+
#[cfg(target_pointer_width = "64")]
631+
let atime_spec = TimeSpec::new(atime_sec, atime_nsec);
632+
633+
#[cfg(target_pointer_width = "32")]
629634
let mtime_spec = TimeSpec::new(
630635
mtime_sec.try_into().unwrap(),
631636
mtime_nsec.try_into().unwrap(),
632637
);
638+
#[cfg(target_pointer_width = "64")]
639+
let mtime_spec = TimeSpec::new(mtime_sec, mtime_nsec);
633640

634641
futimens(&file, &atime_spec, &mtime_spec).map_err(Error::from)
635642
}

tests/by-util/test_nohup.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -247,23 +247,3 @@ fn test_nohup_stderr_to_stdout() {
247247
assert!(content.contains("stdout message"));
248248
assert!(content.contains("stderr message"));
249249
}
250-
251-
#[test]
252-
#[cfg(all(unix, not(target_os = "macos")))]
253-
fn test_nohup_non_utf8_home() {
254-
use std::{ffi::OsStr, os::unix::ffi::OsStrExt};
255-
let ts = TestScenario::new(util_name!());
256-
let at = &ts.fixtures;
257-
258-
at.mkdir("nohup.out");
259-
at.mkdir(OsStr::from_bytes(b"nohup_home\x80"));
260-
let path = at.plus(OsStr::from_bytes(b"nohup_home\x80"));
261-
262-
ts.ucmd()
263-
.terminal_simulation(true)
264-
.env("HOME", path.as_os_str())
265-
.args(&["true"])
266-
.succeeds();
267-
268-
assert!(at.file_exists(path.join("nohup.out")));
269-
}

0 commit comments

Comments
 (0)