rem: sprintf(buf, "/dev/tty%s%d", tmn->name, min);   if(stat(buf, &sbuf) < 0) return 0;
add: sprintf(buf, "/dev/%s%d", tmn->name, min);   if(tmn->devfs_type) { if(stat(buf, &sbuf) < 0) return 0; } else if(stat(buf, &sbuf) < 0) { sprintf(buf, "/dev/%s", tmn->name);   if(stat(buf, &sbuf) < 0) return 0; }
context: static int driver_name(char * const buf, int maj, int min){  struct stat sbuf;  tty_map_node *tmn;  if(!tty_map) load_drivers();  if(tty_map == (tty_map_node *)-1) return 0;  tmn = tty_map;  for(;;){    if(!tmn) return 0;    if(tmn->major_number == maj) break;    tmn = tmn->next;  }  sprintf(buf, "/dev/tty%s%d", tmn->name, min);  /* like "/dev/ttyZZ255" */  if(stat(buf, &sbuf) < 0) return 0;  if(min != minor(sbuf.st_rdev)) return 0;  if(maj != major(sbuf.st_rdev)) return 0;  return 1;}