projects
/
cumulus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
117fafd
)
Dump the device number of character/block devices.
author
Michael Vrable
<mvrable@cs.ucsd.edu>
Wed, 18 Jul 2007 19:59:41 +0000
(12:59 -0700)
committer
Michael Vrable
<mvrable@turin.ucsd.edu>
Wed, 18 Jul 2007 19:59:41 +0000
(12:59 -0700)
scandir.cc
patch
|
blob
|
history
diff --git
a/scandir.cc
b/scandir.cc
index
5d7c9c5
..
89bdaab
100644
(file)
--- a/
scandir.cc
+++ b/
scandir.cc
@@
-348,11
+348,10
@@
void scanfile(const string& path, bool include)
case S_IFSOCK:
inode_type = 's';
break;
- case S_IFCHR:
- inode_type = 'c';
- break;
case S_IFBLK:
- inode_type = 'b';
+ case S_IFCHR:
+ inode_type = ((stat_buf.st_mode & S_IFMT) == S_IFBLK) ? 'b' : 'c';
+ file_info["device"] = encode_int(stat_buf.st_rdev);
break;
case S_IFLNK:
inode_type = 'l';