summaryrefslogtreecommitdiff
path: root/plugins/dfcdrom/cdrcfg-0.1df
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-07-09 04:15:47 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-07-09 04:15:47 +0000
commite52097ddfe6c54547af8e3e47aadd33e385a4db7 (patch)
treeca50fc5e6fb434d712fdd47c1fc1ed21ca0f47c4 /plugins/dfcdrom/cdrcfg-0.1df
parent83e06df4098064f5e4ca3c9ae1214019e934e907 (diff)
downloadpcsxr-e52097ddfe6c54547af8e3e47aadd33e385a4db7.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@54386 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfcdrom/cdrcfg-0.1df')
-rw-r--r--plugins/dfcdrom/cdrcfg-0.1df/main.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/plugins/dfcdrom/cdrcfg-0.1df/main.c b/plugins/dfcdrom/cdrcfg-0.1df/main.c
index 2ab7c851..0fdd09fd 100644
--- a/plugins/dfcdrom/cdrcfg-0.1df/main.c
+++ b/plugins/dfcdrom/cdrcfg-0.1df/main.c
@@ -107,14 +107,41 @@ void fill_drives_list(GtkWidget *widget) {
"/dev/scd2",
"/dev/scd3",
"/dev/optcd",
- NULL};
+ ""};
#elif defined (__FreeBSD__)
static const char *cdrom_devices[] = {
"/dev/acd0",
"/dev/acd1",
"/dev/acd2",
"/dev/acd3",
- NULL};
+ ""};
+#elif defined (__sun)
+ char cdrom_devices[256][256];
+ FILE *fp;
+ char buf[256], *devname, *nick;
+
+ memset(cdrom_devices, 0, sizeof(cdrom_devices));
+
+ i = 0;
+
+ fp = popen("eject -l", "r");
+
+ if (fp != NULL) {
+ while (!feof(fp) && i < 256) {
+ fgets(buf, 256, fp);
+
+ devname = strtok(buf, " ");
+ nick = strtok(NULL, " ");
+
+ if (devname == NULL || nick == NULL) continue;
+
+ if (strstr(nick, "cdrom") != NULL) {
+ strcpy(cdrom_devices[i], devname);
+ }
+ }
+
+ pclose(fp);
+ }
#else
static const char *cdrom_devices[] = { NULL };
#endif
@@ -126,7 +153,7 @@ void fill_drives_list(GtkWidget *widget) {
gtk_list_store_set(store, &iter, 0, CdromDev, -1);
// scan cdrom_devices for real cdrom and add them to list
- while (cdrom_devices[i] != NULL) {
+ while (cdrom_devices[i][0] != '\0') {
// check that is not our current dev (already in list)
if (strcmp(cdrom_devices[i], CdromDev) != 0) {
// check that is a cdrom device