chiark / gitweb /
[PATCH] scsi_id: when udevstart is started, /tmp is not writeable.
[elogind.git] / extras / scsi_id / scsi_id.c
index 6395b822ced7925ff0118d0c89feb728796d7ee0..f45563d1b3b9ed328318ff8f909051e92d144188 100644 (file)
@@ -44,8 +44,8 @@
 /*
  * temporary names for mknod.
  */
-#define TMP_DIR        "/tmp"
-#define TMP_PREFIX "scsi"
+#define TMP_DIR        "/dev"
+#define TMP_PREFIX "tmp-scsi"
 
 /*
  * XXX Note the 'e' (send output to stderr in all cases), and 'c' (callout)
@@ -713,7 +713,8 @@ static int scsi_id(const char *target_path, char *maj_min_dev)
 
 #define ALIGN   512
        unaligned_buf = malloc(MAX_SERIAL_LEN + ALIGN);
-       serial = (char*) (((int) unaligned_buf + (ALIGN - 1)) & ~(ALIGN - 1));
+       serial = (char*) (((unsigned long) unaligned_buf + (ALIGN - 1))
+                         & ~(ALIGN - 1));
        dprintf("buffer unaligned 0x%p; aligned 0x%p\n", unaligned_buf, serial);
 #undef ALIGN