Browse Source

fix(net): format codes

Samuka007 2 weeks ago
parent
commit
0be24a7d79
2 changed files with 6 additions and 7 deletions
  1. 2 1
      kernel/src/net/posix.rs
  2. 4 6
      kernel/src/net/socket/unix/stream/mod.rs

+ 2 - 1
kernel/src/net/posix.rs

@@ -199,7 +199,8 @@ impl SockAddr {
                         crate::filesystem::vfs::fcntl::AtFlags::AT_FDCWD.bits(),
                         path.trim(),
                     )?;
-                    let inode = inode_begin.lookup_follow_symlink(&path, VFS_MAX_FOLLOW_SYMLINK_TIMES)?;
+                    let inode =
+                        inode_begin.lookup_follow_symlink(&path, VFS_MAX_FOLLOW_SYMLINK_TIMES)?;
 
                     return Ok(Endpoint::Unixpath((inode.metadata()?.inode_id, path)));
                 }

+ 4 - 6
kernel/src/net/socket/unix/stream/mod.rs

@@ -162,12 +162,10 @@ impl Socket for StreamSocket {
         //找到对端socket
         let (peer_inode, sun_path) = match server_endpoint {
             Endpoint::Inode((inode, path)) => (inode, path),
-            Endpoint::Unixpath((inode_id, path)) => {
-                match INODE_MAP.read_irqsave().get(&inode_id) {
-                    Some(Endpoint::Inode((inode, _))) => (inode.clone(), path),
-                    _ => return Err(SystemError::EINVAL),
-                }
-            }
+            Endpoint::Unixpath((inode_id, path)) => match INODE_MAP.read_irqsave().get(&inode_id) {
+                Some(Endpoint::Inode((inode, _))) => (inode.clone(), path),
+                _ => return Err(SystemError::EINVAL),
+            },
             Endpoint::Abspath((abs_addr, path)) => {
                 match ABS_INODE_MAP.lock_irqsave().get(&abs_addr.name()) {
                     Some(Endpoint::Inode((inode, _))) => (inode.clone(), path),