mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 02:58:02 +02:00
perf: Check for and include unistd.h
isatty() and access() require unistd.h, so include it!
This commit is contained in:
parent
271752b944
commit
e1f0c2e73f
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue