summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2010-04-16 01:04:22 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-04-21 21:20:18 -0700
commitae6ada745e48a6366cb91a5ce6692e22ad8077ae (patch)
treedd7232097675d781fa4f11b64f1d177992212e95
parent17f97355310d75b05bb3f7a1007ca752fe100029 (diff)
Assume POSIX, lose support for old Minix & LynxOS
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--lndir.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/lndir.c b/lndir.c
index dc767c0..4978f17 100644
--- a/lndir.c
+++ b/lndir.c
@@ -51,27 +51,10 @@ in this Software without prior written authorization from The Open Group.
#include <stdlib.h>
#include <sys/stat.h>
#include <limits.h>
-#if !defined(MINIX) && !defined(Lynx)
#include <sys/param.h>
-#endif
#include <errno.h>
-
-#ifndef X_NOT_POSIX
-#include <dirent.h>
-#else
-#ifdef SYSV
#include <dirent.h>
-#else
-#ifdef USG
-#include <dirent.h>
-#else
-#include <sys/dir.h>
-#ifndef dirent
-#define dirent direct
-#endif
-#endif
-#endif
-#endif
+
#ifndef MAXPATHLEN
#define MAXPATHLEN 2048
#endif
@@ -204,11 +187,7 @@ dodir (char *fn, /* name of "from" directory, either absolute or
continue;
}
-#ifdef S_ISDIR
- if(S_ISDIR(sb.st_mode))
-#else
- if ((sb.st_mode & S_IFMT) == S_IFDIR)
-#endif
+ if (S_ISDIR(sb.st_mode))
{
/* directory */
n_dirs--;
@@ -377,11 +356,7 @@ main (int ac, char *av[])
/* to directory */
if (stat (tn, &ts) < 0)
quiterr (1, tn);
-#ifdef S_ISDIR
if (!(S_ISDIR(ts.st_mode)))
-#else
- if (!(ts.st_mode & S_IFMT) == S_IFDIR)
-#endif
quit (2, "%s: Not a directory", tn);
if (chdir (tn) < 0)
quiterr (1, tn);
@@ -389,11 +364,7 @@ main (int ac, char *av[])
/* from directory */
if (stat (fn, &fs) < 0)
quiterr (1, fn);
-#ifdef S_ISDIR
if (!(S_ISDIR(fs.st_mode)))
-#else
- if (!(fs.st_mode & S_IFMT) == S_IFDIR)
-#endif
quit (2, "%s: Not a directory", fn);
exit (dodir (fn, &fs, &ts, 0));