From 7ba30596ce9f6bd86f86d65805412d9e81d2b715 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 13 Jun 2010 19:07:52 +0000 Subject: [PATCH] New less obtrusive implementation of sg_is_enumerable_adr for Solaris --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/sg-solaris.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 20da97a..fbaffd9 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2010.06.11.104830" +#define Cdrskin_timestamP "2010.06.13.190707" diff --git a/libburn/sg-solaris.c b/libburn/sg-solaris.c index 498d360..2d83440 100644 --- a/libburn/sg-solaris.c +++ b/libburn/sg-solaris.c @@ -717,6 +717,27 @@ int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no, /** Tells wether a text is a persistent address as listed by the enumeration functions. */ + +#ifndef NIX + +int sg_is_enumerable_adr(char* path) +{ + int ret; + int bus_no, target_no, lun_no; + struct stat stbuf; + + if (strncmp("/dev/rdsk/", path, 10) != 0) + return 0; + ret = decode_btl_solaris(path + 10, &bus_no, &target_no, &lun_no, 0); + if (ret <= 0) + return 0; + if (stat(path, &stbuf) == -1) + return 0; + return 1; +} + +#else /* ! NIX */ + int sg_is_enumerable_adr(char* adr) { burn_drive_enumerator_t idx; @@ -736,6 +757,8 @@ int sg_is_enumerable_adr(char* adr) sg_give_next_adr(&idx, buf, sizeof(buf), -1); return (0); } +#endif /* NIX */ +