Skip to content

Commit 169d8a9

Browse files
committed
Process: fix imports of frida namespaced glib functions
1 parent 4fc4605 commit 169d8a9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

frida-gum/src/process.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ impl<'a> Process<'a> {
131131
pub fn current_dir(&self) -> String {
132132
unsafe {
133133
#[cfg(target_os = "linux")]
134-
CStr::from_ptr(_frida_g_get_current_dir())
135-
.to_string_lossy()
136-
.to_string()
134+
let dir = _frida_g_get_current_dir();
137135
#[cfg(not(target_os = "linux"))]
138-
CStr::from_ptr(_g_get_current_dir())
136+
let dir = _g_get_current_dir();
137+
138+
CStr::from_ptr(dir)
139139
.to_string_lossy()
140140
.to_string()
141141
}
@@ -145,11 +145,11 @@ impl<'a> Process<'a> {
145145
pub fn tmp_dir(&self) -> String {
146146
unsafe {
147147
#[cfg(target_os = "linux")]
148-
CStr::from_ptr(_frida_g_get_tmp_dir())
149-
.to_string_lossy()
150-
.to_string()
148+
let dir = _frida_g_get_tmp_dir();
151149
#[cfg(not(target_os = "linux"))]
152-
CStr::from_ptr(_g_get_tmp_dir())
150+
let dir = _g_get_tmp_dir();
151+
152+
CStr::from_ptr(dir)
153153
.to_string_lossy()
154154
.to_string()
155155
}
@@ -159,11 +159,11 @@ impl<'a> Process<'a> {
159159
pub fn home_dir(&self) -> String {
160160
unsafe {
161161
#[cfg(target_os = "linux")]
162-
CStr::from_ptr(_frida_g_get_home_dir())
163-
.to_string_lossy()
164-
.to_string()
162+
let dir = _frida_g_get_home_dir();
165163
#[cfg(not(target_os = "linux"))]
166-
CStr::from_ptr(_g_get_home_dir())
164+
let dir = _g_get_home_dir();
165+
166+
CStr::from_ptr(dir)
167167
.to_string_lossy()
168168
.to_string()
169169
}

0 commit comments

Comments
 (0)