File tree Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
186186 result = file -> fops -> open (file );
187187 if (result == RT_EOK || result == - RT_ENOSYS )
188188 {
189+ file -> type = FT_DEVICE ;
189190 return 0 ;
190191 }
191192 }
@@ -197,6 +198,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
197198 if (result == RT_EOK || result == - RT_ENOSYS )
198199 {
199200 file -> data = device ;
201+ file -> type = FT_DEVICE ;
200202 return RT_EOK ;
201203 }
202204 }
Original file line number Diff line number Diff line change 5555#define FT_SOCKET 1 /* socket file */
5656#define FT_DIRECTORY 2 /* directory */
5757#define FT_USER 3 /* user defined */
58+ #define FT_DEVICE 4 /* device */
5859
5960/* File flags */
6061#define DFS_F_OPEN 0x01000000
Original file line number Diff line number Diff line change @@ -542,6 +542,7 @@ int list_fd(void)
542542 else if (fd -> type == FT_REGULAR ) rt_kprintf ("%-7.7s " , "file" );
543543 else if (fd -> type == FT_SOCKET ) rt_kprintf ("%-7.7s " , "socket" );
544544 else if (fd -> type == FT_USER ) rt_kprintf ("%-7.7s " , "user" );
545+ else if (fd -> type == FT_DEVICE ) rt_kprintf ("%-7.7s " , "device" );
545546 else rt_kprintf ("%-8.8s " , "unknown" );
546547 rt_kprintf ("%3d " , fd -> ref_count );
547548 rt_kprintf ("%04x " , fd -> magic );
You can’t perform that action at this time.
0 commit comments