mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
cp: fix recursive socket file copy
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
//spell-checker: ignore (linux) rlimit prlimit coreutil ggroups uchild uncaptured scmd SHLVL canonicalized openpty
|
||||
//spell-checker: ignore (linux) winsize xpixel ypixel setrlimit FSIZE SIGBUS SIGSEGV sigbus tmpfs
|
||||
//spell-checker: ignore (linux) winsize xpixel ypixel setrlimit FSIZE SIGBUS SIGSEGV sigbus tmpfs mksocket
|
||||
|
||||
#![allow(dead_code)]
|
||||
#![allow(
|
||||
@@ -34,6 +34,8 @@ use std::os::fd::OwnedFd;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::{PermissionsExt, symlink as symlink_dir, symlink as symlink_file};
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::net::UnixListener;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::process::CommandExt;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::process::ExitStatusExt;
|
||||
@@ -1132,6 +1134,13 @@ impl AtPath {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
pub fn mksocket(&self, socket: &str) {
|
||||
let full_path = self.plus_as_string(socket);
|
||||
log_info("mksocket", &full_path);
|
||||
UnixListener::bind(full_path).expect("Socket file creation failed.");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn is_fifo(&self, fifo: &str) -> bool {
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user