* devices.h (_minor): Coerce argument to proper type before manipulating.

(_major): Ditto.
(device::is_fs_special): New function.
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Set the size to 0 for
devices rather than reporting the size of the symlink.
(fhandler_disk_file::readdir): Use is_fs_special to determine if .lnk should be
stripped.
* path.cc: Rename symlink_info::is_symlink to symlink_info::issymlink
throughout.
(symlink_info::isdevice): New field.
(path_conv::check): Use 'isdevice' to determine if just-parsed entity is a
device rather than relying on non-zero major/minor.
(symlink_info::parse_device): Set isdevice to true if we've discovered a
device.
(symlink_info::check): Clear isdevice field prior to processing.  Use isdevice
to control debugging output.
(symlink_info::set): Set isdevice to false.
* path.h (path_conv::is_fs_special): New function.
* devices.cc: Regenerate.
This commit is contained in:
Christopher Faylor
2005-12-01 17:33:59 +00:00
parent 32e616339a
commit c57b13f9f8
5 changed files with 51 additions and 29 deletions

View File

@ -14,8 +14,8 @@ typedef mode_t _mode_t;
typedef __dev32_t _dev_t;
#define FHDEV(maj, min) ((((unsigned) (maj)) << (sizeof (_major_t) * 8)) | (unsigned) (min))
#define _minor(dev) ((dev) & ((1 << (sizeof (_minor_t) * 8)) - 1))
#define _major(dev) ((dev) >> (sizeof (_major_t) * 8))
#define _minor(dev) (((_minor_t) dev) & ((1 << (sizeof (_minor_t) * 8)) - 1))
#define _major(dev) (((_major_t) dev) >> (sizeof (_major_t) * 8))
enum fh_devices
{
@ -149,6 +149,7 @@ struct device
inline operator int () const {return devn;}
inline void setfs (bool x) {dev_on_fs = x;}
inline bool isfs () const {return dev_on_fs || devn == FH_FS;}
inline bool is_fs_special () const {return dev_on_fs && devn != FH_FS;}
};
extern const device *console_dev;