summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-07-30 01:13:46 +0000
committerfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-07-30 01:13:46 +0000
commit2dae1ae58e6d9a4b5723d2ea7e6847f39d30e094 (patch)
tree9203f8baa3b386dcc7aa46033a671eed78e48b39
parentd6bf4639327e834ca2d08942c26a529c41d937d3 (diff)
downloaddistcc-2dae1ae58e6d9a4b5723d2ea7e6847f39d30e094.tar.gz
Apply patch from e...@jessies.org in
<http://code.google.com/p/distcc/issues/detail?id=9>: use S_ISLNK and S_ISDIR macros, to make the code more readable. git-svn-id: http://distcc.googlecode.com/svn/trunk@565 01de4be4-8c4a-0410-9132-4925637da917
-rw-r--r--src/clirpc.c2
-rw-r--r--src/tempfile.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/clirpc.c b/src/clirpc.c
index ed87251..2156860 100644
--- a/src/clirpc.c
+++ b/src/clirpc.c
@@ -230,7 +230,7 @@ static int dcc_is_link(const char *fname, int *is_link)
return EXIT_IO_ERROR;
}
- *is_link = ((buf.st_mode & S_IFLNK) == S_IFLNK);
+ *is_link = S_ISLNK(buf.st_mode);
return 0;
}
diff --git a/src/tempfile.c b/src/tempfile.c
index 568ee68..6890efb 100644
--- a/src/tempfile.c
+++ b/src/tempfile.c
@@ -113,7 +113,7 @@ int dcc_mk_tmpdir(const char *path)
* all is well, but we should not it delete later, since we did
* not make it.
*/
- if ((buf.st_mode & S_IFDIR) == S_IFDIR) {
+ if (S_ISDIR(buf.st_mode)) {
return 0;
} else {
rs_log_error("mkdir '%s' failed: %s", path, strerror(errno));