/* #include <linux/bsg.h> */
#include "bsg.h"
-#include "../../udev/udev.h"
+#include "libudev.h"
+#include "libudev-private.h"
#include "scsi.h"
#include "scsi_id.h"
int ind;
strncpy(serial, dev_scsi->vendor, VENDOR_LENGTH);
- ind = strlen(serial) - 1;
-
strncat(serial, dev_scsi->model, MODEL_LENGTH);
- ind = strlen(serial) - 1;
- ind++;
+ ind = strlen(serial);
/*
* This is not a complete check, since we are using strncat/cpy
if (ind != (VENDOR_LENGTH + MODEL_LENGTH)) {
info(udev, "%s: expected length %d, got length %d\n",
dev_scsi->kernel, (VENDOR_LENGTH + MODEL_LENGTH), ind);
- return 1;
+ return -1;
}
return ind;
}
/*
* XXX Some devices (IBM 3542) return all spaces for an identifier if
- * the LUN is not actually configured. This leads to identifers of
+ * the LUN is not actually configured. This leads to identifiers of
* the form: "1 ".
*/
len = 1 + VENDOR_LENGTH + MODEL_LENGTH + buf[3];
if (max_len < len) {
info(udev, "%s: length %d too short - need %d\n",
- dev_scsi->kernel, max_len, len);
+ dev_scsi->kernel, max_len, len);
return 1;
}
/*