--- linux-2.4.0-test13-pre4/fs/devfs/base.c Fri Nov 17 11:36:27 2000 +++ linux/fs/devfs/base.c Sun Dec 10 13:50:29 2000 @@ -1238,6 +1253,7 @@ { int is_new; struct devfs_entry *de; + int numeric_suffix; if (name == NULL) { @@ -1292,8 +1308,16 @@ minor = next_devnum_block & 0xff; ++next_devnum_block; } - de = search_for_entry (dir, name, strlen (name), TRUE, TRUE, &is_new, - FALSE); + numeric_suffix = 0; + do { + char realname[strlen(name)+11]; /* max 32-bit decimal integer is 10 + characters, plus one for + terminating null. */ + sprintf(realname, name, numeric_suffix); + numeric_suffix++; + de = search_for_entry (dir, realname, strlen (realname), TRUE, TRUE, + &is_new, FALSE); + } while (!is_new && de != NULL && strcmp(name+strlen(name)-2, "%d") == 0); if (de == NULL) { printk ("%s: devfs_register(): could not create entry: \"%s\"\n",