mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
virtiofsd: Trim down imported files
There's a lot of the original fuse code we don't need; trim them down. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> with additional trimming by: Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
@@ -42,32 +42,6 @@ static int mknod_wrapper(int dirfd, const char *path, const char *link,
|
||||
res = symlinkat(link, dirfd, path);
|
||||
} else if (S_ISFIFO(mode)) {
|
||||
res = mkfifoat(dirfd, path, mode);
|
||||
#ifdef __FreeBSD__
|
||||
} else if (S_ISSOCK(mode)) {
|
||||
struct sockaddr_un su;
|
||||
int fd;
|
||||
|
||||
if (strlen(path) >= sizeof(su.sun_path)) {
|
||||
errno = ENAMETOOLONG;
|
||||
return -1;
|
||||
}
|
||||
fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (fd >= 0) {
|
||||
/*
|
||||
* We must bind the socket to the underlying file
|
||||
* system to create the socket file, even though
|
||||
* we'll never listen on this socket.
|
||||
*/
|
||||
su.sun_family = AF_UNIX;
|
||||
strncpy(su.sun_path, path, sizeof(su.sun_path));
|
||||
res = bindat(dirfd, fd, (struct sockaddr*)&su,
|
||||
sizeof(su));
|
||||
if (res == 0)
|
||||
close(fd);
|
||||
} else {
|
||||
res = -1;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
res = mknodat(dirfd, path, mode, rdev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user