summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2019-10-02 00:01:55 +0200
committerJens Georg <mail@jensge.org>2019-10-02 00:02:30 +0200
commita927a6370c2f21cd6ff44c623cba670fdb9aaf13 (patch)
tree816bdf31fc0bc7da2a1a96c12754d333c3a985ca
parent4d02b78b5c897b5087396111f26c48f21e49246e (diff)
downloadrygel-a927a6370c2f21cd6ff44c623cba670fdb9aaf13.tar.gz
engine-simple: Use IOError.from_errno
-rw-r--r--src/media-engines/simple/rygel-simple-data-source.vala8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/media-engines/simple/rygel-simple-data-source.vala b/src/media-engines/simple/rygel-simple-data-source.vala
index 1fc74017..f884e7fa 100644
--- a/src/media-engines/simple/rygel-simple-data-source.vala
+++ b/src/media-engines/simple/rygel-simple-data-source.vala
@@ -144,9 +144,7 @@ internal class Rygel.SimpleDataSource : DataSource, Object {
try {
fd = Posix.open (file.get_path (), Posix.O_RDONLY, 0);
if (fd < 0) {
- throw new IOError.FAILED ("Failed to open file '%s': %s",
- file.get_path (),
- Posix.strerror (Posix.errno));
+ throw IOError.from_errno (errno);
}
if (this.last_byte == 0) {
@@ -191,9 +189,7 @@ internal class Rygel.SimpleDataSource : DataSource, Object {
var slice = new uint8[stop - start];
var len = (int) Posix.read (fd, slice, slice.length);
if (len < 0) {
- throw new IOError.FAILED ("Failed to read file '%s': %s",
- file.get_path (),
- Posix.strerror (Posix.errno));
+ throw IOError.from_errno (errno);
}
slice.length = len;