static char *table[] = {
"", "d360", "h1200", "u360", "u720", "h360", "h720",
static char *table[] = {
"", "d360", "h1200", "u360", "u720", "h360", "h720",
static int t360[] = { 1, 0 };
static int t1200[] = { 2, 5, 6, 10, 12, 14, 16, 18, 20, 23, 0 };
static int t3in[] = { 8, 9, 26, 27, 28, 7, 11, 15, 19, 24, 25, 29, 31, 3, 4, 13, 17, 21, 22, 30, 0 };
static int t360[] = { 1, 0 };
static int t1200[] = { 2, 5, 6, 10, 12, 14, 16, 18, 20, 23, 0 };
static int t3in[] = { 8, 9, 26, 27, 28, 7, 11, 15, 19, 24, 25, 29, 31, 3, 4, 13, 17, 21, 22, 30, 0 };
+static int *table_sup[] = { NULL, t360, t1200, t3in+5+8, t3in+5, t3in, t3in };
+
+#ifdef USE_LOG
+void log_message(int priority, const char *format, ...)
+{
+ va_list args;
+ static int udev_log = -1;
+
+ if (udev_log == -1) {
+ const char *value;
+
+ value = getenv("UDEV_LOG");
+ if (value)
+ udev_log = log_priority(value);
+ else
+ udev_log = LOG_ERR;
+ }
-static int *table_sup[] = { NULL, t360, t1200, t3in + 5 + 8, t3in + 5, t3in, t3in };
+ if (priority > udev_log)
+ return;
+
+ va_start(args, format);
+ vsyslog(priority, format, args);
+ va_end(args);
+}
+#endif
char node[64];
int type = 0, i, fdnum, c;
int major = 2, minor;
char node[64];
int type = 0, i, fdnum, c;
int major = 2, minor;
- fprintf(stderr,"Usage: %s [-d|-c|-u|-m <major>|-t <type>] <device>\n",
- argv[0]);
+ printf("Usage: %s [OPTION] device\n"
+ " -c create\n"
+ " -d debug\n"
+ " -m Major number\n"
+ " -t floppy type number\n"
+ " -U device node user ownership\n"
+ " -G device node group owner\n"
+ " -M device node mode\n"
+ "\n", argv[0]);
- sprintf(node, "%s%s",dev, table[table_sup[type][i]]);
+ sprintf(node, "%s%s", dev, table[table_sup[type][i]]);
minor = (table_sup[type][i] << 2) + fdnum;
if (print_nodes)
printf("%s b %d %d %d\n", node, mode, major, minor);
minor = (table_sup[type][i] << 2) + fdnum;
if (print_nodes)
printf("%s b %d %d %d\n", node, mode, major, minor);
mknod(node, S_IFBLK | mode, makedev(major,minor));
mknod(node, S_IFBLK | mode, makedev(major,minor));