summaryrefslogtreecommitdiffstats
path: root/sysutils/nautilus-cd-burner/files/patch-nautilus-burn-drive.c
blob: e836eb9823f8d90102646098f97de762ef916f6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- nautilus-burn-drive.c.orig  Tue Aug 23 11:55:56 2005
+++ nautilus-burn-drive.c   Sat Sep 10 20:32:26 2005
@@ -471,7 +471,6 @@ get_disc_type (const char *dev_path)
    struct cd_toc_entry              entry;
    int                              i;
 #endif
-   int                              type;
 #ifndef CDROM_DATA_TRACK
 #define CDROM_DATA_TRACK 4
 #endif
@@ -483,6 +482,10 @@ get_disc_type (const char *dev_path)
 
    if (ioctl (fd, CDIOREADTOCHEADER, &header) < 0) {
        close (fd);
+       if (errno == EINVAL)
+           /* If you try to read the TOC header of a blank disc
+            * on FreeBSD, you get EINVAL. */
+           return CDS_NO_INFO;
            return -1;
    }
 
@@ -649,7 +652,7 @@ nautilus_burn_drive_get_media_type_from_
        *is_blank = mmc_profile & 0x10000;
 
    disc_type = get_disc_type (device);
-   disc_type_get_info (disc_type, is_blank, has_data, has_audio);
+   disc_type_get_info (disc_type, NULL, has_data, has_audio);
 
    switch (mmc_profile & 0xFFFF) {
    case -1: