From 610e8ff500c68603d8a6262f285d0456af810aae Mon Sep 17 00:00:00 2001 From: mouring Date: Mon, 19 Mar 2001 03:12:25 +0000 Subject: [PATCH] - (bal) NeXTStep lacks S_ISLNK. Plus split up S_IS* --- ChangeLog | 1 + defines.h | 9 ++++++++- openbsd-compat/realpath.c | 7 ------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index de5560da..a2b6f98b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ - (bal) Use 'NGROUPS' for NeXT Since 'MAX_NGROUPS' is wrapped up in -lposix stuff. Change suggested by Mark Miller - (bal) Small fix to scp. %lu vs %ld + - (bal) NeXTStep lacks S_ISLNK. Plus split up S_IS* 20010318 - (bal) Fixed scp type casing issue which causes "scp: protocol error: diff --git a/defines.h b/defines.h index 0871d839..160cdefe 100644 --- a/defines.h +++ b/defines.h @@ -99,11 +99,18 @@ enum # define O_NONBLOCK 00004 #endif -#ifndef S_ISREG +#ifndef S_ISDIR # define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR)) +#endif /* S_ISDIR */ + +#ifndef S_ISREG # define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG)) #endif /* S_ISREG */ +#ifndef S_ISLNK +# define S_ISLNK(mode) (((mode) & (_S_IFMT)) == (_S_IFLNK)) +#endif /* S_ISLNK */ + #ifndef S_IXUSR # define S_IXUSR 0000100 /* execute/search permission, */ # define S_IXGRP 0000010 /* execute/search permission, */ diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c index baf17f1a..fbe2a9c2 100644 --- a/openbsd-compat/realpath.c +++ b/openbsd-compat/realpath.c @@ -44,13 +44,6 @@ static char *rcsid = "$OpenBSD: realpath..c,v 1.4 1998/05/18 09:55:19 deraadt Ex #include #include -/* - * S_ISLNK compatibility - */ -#ifndef S_ISLNK -#define S_ISLNK(m) ((m & 0170000) == 0120000) -#endif - /* * MAXSYMLINKS */ -- 2.45.1