lkml.org 
[lkml]   [2013]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/8] perf tools: Add support to preload default formulas
On 5/1/13 9:15 AM, Jiri Olsa wrote:
> +int perf_formula__load_dir(struct perf_formula *f, char *path)
> +{
> + struct dirent *ent;
> + DIR *dir;
> + int ret = 0;
> +
> + dir = opendir(path);
> + if (!dir) {
> + pr_err("formula: can't open dir '%s' - %s\n",
> + path, strerror(errno));
> + return -1;
> + }
> +
> + while (!ret && (ent = readdir(dir))) {
> + char file[PATH_MAX];

readdir_r? this is going into libperf, so might as well be thread safe.

David


\
 
 \ /
  Last update: 2013-05-03 17:41    [W:0.129 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site