summaryrefslogtreecommitdiff
path: root/libjuicer
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@oracle.com>2011-10-10 15:17:06 +0100
committerRoss Burton <ross@linux.intel.com>2011-10-10 15:19:41 +0100
commit3ecf057ab04d63c8eb80aa8f66848d52a605bd27 (patch)
treeff1a5a641b6571aa3af9ec6d91aab42aaed64c81 /libjuicer
parent624b01cb7775037ea2f6ec5076b87e2c61adfa5e (diff)
Fix device names on Solaris (#540857)
Solaris is unique that it separates /dev/dsk and /dev/rdsk where /dev/dsk is the logical name for the drive and /dev/rdsk is the raw device name. You need to use the raw device name to acutally access the device. For example, you can refer here for more information: http://docs.sun.com/app/docs/doc/801-7038/6i1cfovsu?a=view Note that the sound-juicer code already has some code to manage this in the function sj_metadata_getter_set_cdrom() in libjuicer/sj-metadata-getter.c. The attached patch adds 3 more places in the code where "/dev/rdsk" is needed for sound-juicer to work well on Solaris. It also fixes the one place in libjuicer/sj-metadata-getter.c which already references "/dev/rdsk" so the #ifdef matches the others. THere is no need to also check for "__SVR4". Signed-off-by: Ross Burton <ross@linux.intel.com>
Diffstat (limited to 'libjuicer')
-rw-r--r--libjuicer/sj-metadata-getter.c2
-rw-r--r--libjuicer/sj-metadata-gvfs.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/libjuicer/sj-metadata-getter.c b/libjuicer/sj-metadata-getter.c
index 2d3ec88..0ae49b3 100644
--- a/libjuicer/sj-metadata-getter.c
+++ b/libjuicer/sj-metadata-getter.c
@@ -119,7 +119,7 @@ sj_metadata_getter_set_cdrom (SjMetadataGetter *mdg, const char* device)
g_free (priv->cdrom);
-#if defined (sun) && defined (__SVR4)
+#ifdef __sun
if (g_str_has_prefix (device, "/dev/dsk/")) {
priv->cdrom = g_strdup_printf ("/dev/rdsk/%s", device + strlen ("/dev/dsk/"));
return;
diff --git a/libjuicer/sj-metadata-gvfs.c b/libjuicer/sj-metadata-gvfs.c
index 5d31b10..f9fb95a 100644
--- a/libjuicer/sj-metadata-gvfs.c
+++ b/libjuicer/sj-metadata-gvfs.c
@@ -63,7 +63,11 @@ device_to_cdda_uri (const char *device)
{
if (g_str_has_prefix (device, "/dev/") == FALSE)
return NULL;
+#ifdef __sun
+ return g_strdup_printf ("cdda://%s", device + strlen ("/dev/rdsk/"));
+#else
return g_strdup_printf ("cdda://%s", device + strlen ("/dev/"));
+#endif
}
static GList *