Hello,
mostly purely theoretical, but we might get 0 as fd from open.
I used the exact -1 check, because e.g. WinCE will also use other
negative value as file descriptors (it basically just uses memory
pointers cast to int as far as I know) and I don't see a good reason
to check for >= 0 instead.

Index: vm/vm.c
===================================================================
--- vm/vm.c     (revision 1243)
+++ vm/vm.c     (working copy)
@@ -172,7 +172,7 @@
 
     /* Read DVD name */
     fd = open(device, O_RDONLY);
-    if (fd > 0) {
+    if (fd != -1) {
       off = lseek( fd, 32 * (off_t) DVD_VIDEO_LB_LEN, SEEK_SET );
       if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) {
         off = read( fd, data, DVD_VIDEO_LB_LEN );

_______________________________________________
DVDnav-discuss mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss

Reply via email to