Skip to content

Commit fd08d3c

Browse files
committed
chcon/runcon: Only build on Linux
This feels a bit strange...
1 parent 87f9b7a commit fd08d3c

File tree

7 files changed

+10
-0
lines changed

7 files changed

+10
-0
lines changed

src/uu/chcon/src/chcon.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55
// spell-checker:ignore (vars) RFILE
6+
#![cfg(target_os = "linux")]
67
#![allow(clippy::upper_case_acronyms)]
78

89
use clap::builder::ValueParser;

src/uu/chcon/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
5+
#![cfg(target_os = "linux")]
6+
57
use std::ffi::OsString;
68
use std::fmt::Write;
79
use std::io;

src/uu/chcon/src/fts.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
5+
#![cfg(target_os = "linux")]
6+
57
use std::ffi::{CStr, CString, OsStr};
68
use std::marker::PhantomData;
79
use std::os::raw::{c_int, c_long, c_short};

src/uu/chcon/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#![cfg(target_os = "linux")]
12
uucore::bin!(uu_chcon);

src/uu/runcon/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
5+
#![cfg(target_os = "linux")]
6+
57
use std::ffi::OsString;
68
use std::fmt::{Display, Formatter, Write};
79
use std::io;

src/uu/runcon/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#![cfg(target_os = "linux")]
12
uucore::bin!(uu_runcon);

src/uu/runcon/src/runcon.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
55
// spell-checker:ignore (vars) RFILE
6+
#![cfg(target_os = "linux")]
67

78
use clap::builder::ValueParser;
89
use uucore::error::{UClapError, UError, UResult};

0 commit comments

Comments
 (0)