return retval;
}
-/* Make a special file which is block, character and fifo */
+/* Make a special files (block and character devices), fifo's, and sockets */
errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name,
struct stat *st)
{
mode = LINUX_S_IFIFO;
filetype = EXT2_FT_FIFO;
break;
+ case S_IFSOCK:
+ mode = LINUX_S_IFSOCK;
+ filetype = EXT2_FT_SOCK;
default:
abort();
/* NOTREACHED */
if (!(fs->flags & EXT2_FLAG_RW)) {
com_err(__func__, 0, "Filesystem opened read/only");
- return -1;
+ return EROFS;
}
retval = ext2fs_new_inode(fs, cwd, 010755, 0, &ino);
if (retval) {
case S_IFCHR:
case S_IFBLK:
case S_IFIFO:
+ case S_IFSOCK:
retval = do_mknod_internal(fs, parent_ino, name, &st);
if (retval) {
com_err(__func__, retval,
goto out;
}
break;
- case S_IFSOCK:
- /* FIXME: there is no make socket function atm. */
- com_err(__func__, 0,
- _("ignoring socket file \"%s\""), name);
- continue;
case S_IFLNK:
read_cnt = readlink(name, ln_target,
sizeof(ln_target) - 1);