summaryrefslogtreecommitdiff
path: root/perf/cairo-perf-trace.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-03-04 17:11:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-03-04 17:11:58 +0000
commite1f0c2e73fa8cda9e38ab182288201fa27a3b363 (patch)
tree72e75b0a70b5269bc9c76e9c4c558ec0365496fd /perf/cairo-perf-trace.c
parent271752b944ef0898b5d1be57f26de83c8e40ae3a (diff)
downloadcairo-e1f0c2e73fa8cda9e38ab182288201fa27a3b363.tar.gz
perf: Check for and include unistd.h
isatty() and access() require unistd.h, so include it!
Diffstat (limited to 'perf/cairo-perf-trace.c')
-rw-r--r--perf/cairo-perf-trace.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 5487eaf66..cc0115830 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -53,6 +53,10 @@
#include <sys/stat.h>
#include <dirent.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include <signal.h>
#if HAVE_FCFINI
@@ -671,8 +675,10 @@ parse_options (cairo_perf_t *perf, int argc, char *argv[])
if (verbose && perf->summary == NULL)
perf->summary = stderr;
+#if HAVE_UNISTD_H
if (perf->summary && isatty (fileno (perf->summary)))
perf->summary_continuous = TRUE;
+#endif
if (optind < argc) {
perf->names = &argv[optind];
@@ -702,9 +708,11 @@ have_trace_filenames (cairo_perf_t *perf)
if (perf->num_names == 0)
return FALSE;
+#if HAVE_UNISTD_H
for (i = 0; i < perf->num_names; i++)
if (access (perf->names[i], R_OK) == 0)
return TRUE;
+#endif
return FALSE;
}