use S_ISDIR and S_ISREG

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25229 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-05-25 23:44:52 +00:00
parent dccd572c45
commit 1e5a14f8bd

View File

@@ -292,16 +292,10 @@ source(int argc, char **argv)
syserr: run_err("%s: %s", name, strerror(errno));
goto next;
}
switch (stb.st_mode & S_IFMT) {
case S_IFREG:
break;
case S_IFDIR:
if (iamrecursive) {
rsource(name, &stb);
goto next;
}
/* FALLTHROUGH */
default:
if (S_ISDIR(stb.st_mode) && iamrecursive) {
rsource(name, &stb);
goto next;
} else if (!S_ISREG(stb.st_mode)) {
run_err("%s: not a regular file", name);
goto next;
}