From: Florian Forster Date: Fri, 25 Dec 2009 10:13:55 +0000 (+0100) Subject: filecount plugin: Use the ?:-operator for the hidden argument. X-Git-Tag: collectd-4.10.0~80 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7b28c721b73652f36f95e2f402a594aca4e2dd15;p=collectd.git filecount plugin: Use the ?:-operator for the hidden argument. --- diff --git a/src/filecount.c b/src/filecount.c index 9f6ea564..47f99e91 100644 --- a/src/filecount.c +++ b/src/filecount.c @@ -478,10 +478,8 @@ static int fc_read_dir_callback (const char *dirname, const char *filename, if (S_ISDIR (statbuf.st_mode) && (dir->options & FC_RECURSIVE)) { - if(dir->options & FC_HIDDEN) - status = walk_directory (abs_path, fc_read_dir_callback, dir,/* include hidden */1); - else - status = walk_directory (abs_path, fc_read_dir_callback, dir,/* include hidden */ 0); + status = walk_directory (abs_path, fc_read_dir_callback, dir, + /* include hidden = */ (dir->options & FC_HIDDEN) ? 1 : 0); return (status); } else if (!S_ISREG (statbuf.st_mode)) @@ -544,10 +542,8 @@ static int fc_read_dir (fc_directory_conf_t *dir) if (dir->mtime != 0) dir->now = time (NULL); - if(dir->options & FC_HIDDEN) - status = walk_directory (dir->path, fc_read_dir_callback, dir,/* include hidden */ 1); - else - status = walk_directory (dir->path, fc_read_dir_callback, dir,/* include hidden */ 0); + status = walk_directory (dir->path, fc_read_dir_callback, dir, + /* include hidden */ (dir->options & FC_HIDDEN) ? 1 : 0); if (status != 0) { WARNING ("filecount plugin: walk_directory (%s) failed.", dir->path);