[shotwell/shotwell-0.26] Do not close FileDescriptor passed to CameraFile
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/shotwell-0.26] Do not close FileDescriptor passed to CameraFile
- Date: Fri, 11 Aug 2017 09:57:45 +0000 (UTC)
commit 6d4c0ff11a496b5d2a47f9269c4e154bf251d987
Author: Jens Georg <mail jensge org>
Date: Thu Aug 10 19:18:10 2017 +0200
Do not close FileDescriptor passed to CameraFile
CameraFile takes ownership of the file descriptor and closes it, so we
end up closing random file descriptors.
Big thanks to Stefan for debugging this
https://bugzilla.gnome.org/show_bug.cgi?id=785503
src/camera/GPhoto.vala | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
---
diff --git a/src/camera/GPhoto.vala b/src/camera/GPhoto.vala
index 5acc4a3..5919080 100644
--- a/src/camera/GPhoto.vala
+++ b/src/camera/GPhoto.vala
@@ -205,18 +205,14 @@ namespace GPhoto {
GPhoto.CameraFile camera_file;
GPhoto.Result res = GPhoto.CameraFile.create_from_fd(out camera_file, fd);
if (res != Result.OK) {
- Posix.close(fd);
throw new GPhotoError.LIBRARY("[%d] Error allocating camera file: %s", (int) res,
res.as_string());
}
res = camera.get_file(folder, filename, GPhoto.CameraFileType.NORMAL, camera_file, context);
if (res != Result.OK) {
- Posix.close(fd);
throw new GPhotoError.LIBRARY("[%d] Error retrieving file object for %s/%s: %s",
(int) res, folder, filename, res.as_string());
}
-
- Posix.close(fd);
}
public PhotoMetadata? load_metadata(Context context, Camera camera, string folder, string filename)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]