From 01ff79f58925dd26a717ae78f201d739053b5477 Mon Sep 17 00:00:00 2001 From: "christophe.varoqui@free.fr" Date: Mon, 22 Dec 2003 20:53:55 -0800 Subject: [PATCH] extras multipath update incremental to 20031222-2, 2003-12-22 multipath-010 * tweak the install target in Makefile * stop passing fds as argument : this change enable a strict segregation of ugly 2.4 code * sysfs version of get_lun_strings() * be careful about the return of get_unique_id() since errors formerly caught up by if(open()) in the caller fn are now returned by get_unique_id() * send get_serial() in unused.c --- extras/multipath/unused.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'extras/multipath/unused.c') diff --git a/extras/multipath/unused.c b/extras/multipath/unused.c index 33b3e859d1..08144cf717 100644 --- a/extras/multipath/unused.c +++ b/extras/multipath/unused.c @@ -1,3 +1,20 @@ +static int +get_serial (int fd, char * str) +{ + char buff[MX_ALLOC_LEN + 1]; + int len; + + if (0 == do_inq(fd, 0, 1, 0x80, buff, MX_ALLOC_LEN, 0)) { + len = buff[3]; + if (len > 0) { + memcpy(str, buff + 4, len); + buff[len] = '\0'; + } + return 1; + } + return 0; +} + static int do_tur(int fd) { -- cgit v1.2.3-54-g00ecf