chiark / gitweb /
[PATCH] extras multipath update
[elogind.git] / extras / multipath / unused.c
index 33b3e859d10940bd40485ae9190dff35c334cc4d..08144cf71719b128a53f27956060c0d2d2e91253 100644 (file)
@@ -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)
 {