[simple-scan] Display error message if unable to open simple-scan.log file
- From: Bartosz <bkosiorek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [simple-scan] Display error message if unable to open simple-scan.log file
- Date: Tue, 1 Sep 2020 21:05:50 +0000 (UTC)
commit 3ac5c61da0d3636741f7ac884a01e75057d136ff
Author: Bartosz Kosiorek <gang65 poczta onet pl>
Date: Tue Sep 1 22:51:13 2020 +0200
Display error message if unable to open simple-scan.log file
Fix: #192
src/simple-scan.vala | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/simple-scan.vala b/src/simple-scan.vala
index 450ac868..3f495e56 100644
--- a/src/simple-scan.vala
+++ b/src/simple-scan.vala
@@ -1982,7 +1982,7 @@ public class SimpleScan : Gtk.Application
}
catch (Error e)
{
- stderr.printf ("Error fixing PDF file: %s", e.message);
+ stderr.printf ("Error fixing PDF file: %s\n", e.message);
return Posix.EXIT_FAILURE;
}
return Posix.EXIT_SUCCESS;
@@ -2002,6 +2002,11 @@ public class SimpleScan : Gtk.Application
DirUtils.create_with_parents (path, 0700);
path = Path.build_filename (Environment.get_user_cache_dir (), "simple-scan", "simple-scan.log",
null);
log_file = FileStream.open (path, "w");
+ if (log_file == null )
+ {
+ stderr.printf ("Error: Unable to open %s file for writing\n", path);
+ return Posix.EXIT_FAILURE;
+ }
Log.set_default_handler (log_cb);
debug ("Starting %s %s, PID=%i", args[0], VERSION, Posix.getpid ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]