changeset 1510:9ffe6c1a33b9

In case the open on the dvd device fails, print some hints based on errno why the open has failed.
author jkeil
date Tue, 14 Aug 2001 12:17:38 +0000
parents f9beae70c5c2
children f29e0c2bb675
files dvdauth.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dvdauth.c	Tue Aug 14 08:18:52 2001 +0000
+++ b/dvdauth.c	Tue Aug 14 12:17:38 2001 +0000
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 //#include <string.h>      // FIXME: conflicts with fs.h
+#include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
@@ -76,7 +77,6 @@
  */
 #ifdef __linux__
 #include <linux/fs.h>
-#include <errno.h>
 
 #ifndef FIBMAP
 #define FIBMAP 1
@@ -185,7 +185,8 @@
     	DVDHandle dvd;  /* DVD device handle */
 
 	if ((dvd=DVDOpenDevice(dev)) == DVDOpenFailed) {
-		fprintf(stderr,"DVD: cannot open DVD device \"%s\".\n",dev);
+		fprintf(stderr,"DVD: cannot open DVD device \"%s\": %s.\n",
+			dev, strerror(errno));
 		return 1;
 	}