[Libsysio-commit] HEAD: libsysio/src open.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-04-02 14:39:56
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30251 Modified Files: open.c Log Message: Cray Red Storm requires support for the O_NOFOLLOW flag to open. Added it for everyone. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- open.c 1 Apr 2004 15:26:20 -0000 1.15 +++ open.c 2 Apr 2004 14:27:46 -0000 1.16 @@ -41,6 +41,11 @@ * le...@sa... */ +/* + * Incorporate the GNU flags for open if we can. + */ +#define _GNU_SOURCE + #include <stdlib.h> #include <string.h> #include <errno.h> @@ -157,7 +162,7 @@ open(const char *path, int flags, ...) va_arg(ap, int); #endif va_end(ap); - mode &= ~(_sysio_umask & 0777); /* apply umask */ + mode &= ~(_sysio_umask & 0777) | 07000; /* apply umask */ if (flags & O_EXCL) { /* @@ -166,6 +171,10 @@ open(const char *path, int flags, ...) intent.int_opmask |= INT_CREAT; } } +#ifdef O_NOFOLLOW + if (flags & O_NOFOLLOW) + ndflags |= ND_NOFOLLOW; +#endif /* * Find the file. |