summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-10-31 18:23:00 +0000
committerMiles Bader <miles@gnu.org>1995-10-31 18:23:00 +0000
commitd6682a9bab19ad96d17fdabacb4953f919e1b426 (patch)
treed2dce09d48a779934378b34a2fcfbb12ad4aa79c /libdiskfs
parent00af9cdb5c5f4210dbee0e1abf39abe2577914f5 (diff)
(diskfs_S_file_set_translator):
Add missing else. Use makedev macro instead of doing it by hand. (makedev): New macro -- temporarily here until libc exports one.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-set-trans.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index 12e3e3b1..fc2b5e7b 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -20,6 +20,9 @@
#include <hurd/paths.h>
#include <hurd/fsys.h>
+/* XXX - Temporary */
+#define makedev(maj,min) ((((maj)&0xFF)<<8)+((min)&0xFF))
+
/* Implement file_set_translator as described in <hurd/fs.defs>. */
kern_return_t
diskfs_S_file_set_translator (struct protid *cred,
@@ -105,7 +108,7 @@ diskfs_S_file_set_translator (struct protid *cred,
if (diskfs_shortcut_symlink && !strcmp (passive, _HURD_SYMLINK))
newmode = S_IFLNK;
- if (diskfs_shortcut_chrdev && !(strcmp (passive, _HURD_CHRDEV)))
+ else if (diskfs_shortcut_chrdev && !(strcmp (passive, _HURD_CHRDEV)))
newmode = S_IFCHR;
else if (diskfs_shortcut_blkdev && !strcmp (passive, _HURD_BLKDEV))
newmode = S_IFBLK;
@@ -150,8 +153,7 @@ diskfs_S_file_set_translator (struct protid *cred,
}
minor = strtol (arg, 0, 0);
- np->dn_stat.st_rdev = (((major & 0377) << 8)
- | (minor & 0377));
+ np->dn_stat.st_rdev = makedev (major, minor);
}
diskfs_truncate (np, 0);