[Libsysio-commit] HEAD: libsysio/src mknod.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-04-14 16:25:55
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6276 Modified Files: mknod.c Log Message: Fixed comment; We support FIFO type now too. Fixed test for type; Use the S_IS macros instead of a direct test for the mode bits. Fixed return value for unsupported types. Was EPERM, now EINVAL. Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- mknod.c 31 Mar 2004 17:43:18 -0000 1.8 +++ mknod.c 14 Apr 2004 16:25:40 -0000 1.9 @@ -79,11 +79,10 @@ __xmknod(int __ver, const char *path, mo } /* - * Support only character-special right now. + * Support only character-special and fifos right now. */ - if (((mode & S_IFMT) != S_IFIFO) && - ((mode & S_IFMT) != S_IFCHR)) { - err = -EPERM; + if (!(S_ISDIR(mode) || S_ISFIFO(mode))) { + err = -EINVAL; goto out; } |