From 6b8e5fa22332f99e3c64a3b27f57a9000567c67c Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Tue, 27 Jun 2017 22:28:20 +0200 Subject: [PATCH] share: fix error handling when creating downloads path --- src/mconnect/share.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mconnect/share.vala b/src/mconnect/share.vala index 436b1d7..f47fa5c 100644 --- a/src/mconnect/share.vala +++ b/src/mconnect/share.vala @@ -37,11 +37,11 @@ class ShareHandler : Object, PacketHandlerInterface { ShareHandler.DOWNLOADS = Path.build_filename( Environment.get_user_special_dir(UserDirectory.DOWNLOAD), "mconnect"); - try { - DirUtils.create_with_parents(ShareHandler.DOWNLOADS, - 0700); - } catch (IOError e) { - warning("failed to create downloads directory: %s", e.message); + + if (DirUtils.create_with_parents(ShareHandler.DOWNLOADS, + 0700) == -1) { + warning("failed to create downloads directory: %s", + Posix.strerror(Posix.errno)); } }