How about a config flag, which means that udev preserves the ownership of an already existing device node (with the correct major, minor numbers)? Btw, we only check if the file we want to create is block or char, not e.g. that we want block and it is char. if (((stats.st_mode & S_IFMT) == S_IFBLK || (stats.st_mode & S_IFMT) == S_IFCHR) && (stats.st_rdev == makedev(major, minor))) should look like: if (((stats.st_mode & S_IFMT) == mode) && (stats.st_rdev == makedev(major, minor)))