mtp: pass error from lseek()
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 18 Aug 2014 18:00:50 +0000 (21:00 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 18 Aug 2014 18:00:50 +0000 (21:00 +0300)
modules/access/mtp.c

index 9cd8023..b38e16e 100644 (file)
@@ -216,7 +216,8 @@ static int Seek( access_t *p_access, uint64_t i_pos )
     p_access->info.i_pos = i_pos;
     p_access->info.b_eof = false;
 
-    lseek( p_access->p_sys->fd, i_pos, SEEK_SET );
+    if (lseek( p_access->p_sys->fd, i_pos, SEEK_SET ) == (off_t)-1)
+        return VLC_EGENERIC;
     return VLC_SUCCESS;
 }