Skip to content

Commit 3058583

Browse files
committed
WIP: Port file_open_tmp (needs verification)
1 parent 6201b60 commit 3058583

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

glib/src/functions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pub fn unix_open_pipe(flags: i32) -> Result<(RawFd, RawFd), Error> {
243243
#[doc(alias = "g_file_open_tmp")]
244244
pub fn file_open_tmp(
245245
tmpl: Option<impl AsRef<std::path::Path>>,
246-
) -> Result<(RawFd, std::path::PathBuf), crate::Error> {
246+
) -> Result<(OwnedFd, std::path::PathBuf), crate::Error> {
247247
unsafe {
248248
let mut name_used = ptr::null_mut();
249249
let mut error = ptr::null_mut();
@@ -253,7 +253,7 @@ pub fn file_open_tmp(
253253
&mut error,
254254
);
255255
if error.is_null() {
256-
Ok((ret.into_raw_fd(), from_glib_full(name_used)))
256+
Ok((OwnedFd::from_raw_fd(ret), from_glib_full(name_used)))
257257
} else {
258258
Err(from_glib_full(error))
259259
}

0 commit comments

Comments
 (0)