Skip to content

Commit 2c46146

Browse files
committed
split personality in submodules instead of using #[cfg] for fixing the lint error
1 parent 56e4922 commit 2c46146

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/unix/notbsd/android/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,8 @@ extern {
808808

809809
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t,
810810
len: ::off_t) -> ::c_int;
811+
812+
pub fn personality(persona: ::c_uint) -> ::c_int;
811813
}
812814

813815
cfg_if! {

src/unix/notbsd/linux/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,7 @@ extern {
11161116
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
11171117
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
11181118
pub fn vhangup() -> ::c_int;
1119+
pub fn personality(persona: ::c_ulong) -> ::c_int;
11191120
}
11201121

11211122
extern {

src/unix/notbsd/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1000,10 +1000,6 @@ extern {
10001000
suid: *mut ::uid_t) -> ::c_int;
10011001
pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t,
10021002
sgid: *mut ::gid_t) -> ::c_int;
1003-
#[cfg(target_os="android")]
1004-
pub fn personality(persona: ::c_uint) -> ::c_int;
1005-
#[cfg(not(target_os="android"))]
1006-
pub fn personality(persona: ::c_ulong) -> ::c_int;
10071003
pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
10081004
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
10091005
pub fn acct(filename: *const ::c_char) -> ::c_int;

0 commit comments

Comments
 (0)