From 1e5a14f8bd268634424f786013daf06ba298aceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 25 May 2009 23:44:52 +0000 Subject: [PATCH] use S_ISDIR and S_ISREG git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25229 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/rcp/rcp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/appl/rcp/rcp.c b/appl/rcp/rcp.c index f31a36b22..13e831ee0 100644 --- a/appl/rcp/rcp.c +++ b/appl/rcp/rcp.c @@ -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; }