From b8060f822bfc833f97eb429dead40b8408f2e79f Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 28 Jun 2007 00:08:21 +0000 Subject: [PATCH] Implement S_ISDIR from S_IFMT or _S_IFMT if necessary (e.g., on Windows) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19645 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/support/mkstemp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/util/support/mkstemp.c b/src/util/support/mkstemp.c index b671c6b56..b68aa4dbd 100644 --- a/src/util/support/mkstemp.c +++ b/src/util/support/mkstemp.c @@ -51,6 +51,16 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93"; #define O_BINARY 0 #endif +#if !defined S_ISDIR +#if defined S_IFMT +#define S_ISDIR(MODE) (((MODE) & S_IFMT) == S_IFDIR) +#elif defined _S_IFMT +#define S_ISDIR(MODE) (((MODE) & _S_IFMT) == _S_IFDIR) +#else +/* Hope that there's a S_ISDIR function defined. */ +#endif +#endif + static int _gettemp(char *, int *); int mkstemp(path) -- 2.26.2