Skip to content

Commit

Permalink
Merge pull request #945 from krzycz/fedora-build_issues
Browse files Browse the repository at this point in the history
Fix build issues on Fedora
  • Loading branch information
krzycz committed Jun 26, 2016
2 parents 1ae90e1 + 354f099 commit 1c8cffc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/test/unittest/unittest.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,15 @@ void ut_err(const char *file, int line, const char *func,

#ifndef _MSC_VER
#define UT_COMPILE_ERROR_ON(cond) ((void)sizeof(char[(cond) ? -1 : 1]))
#ifndef __cplusplus
#define UT_ASSERT_COMPILE_ERROR_ON(cond) UT_COMPILE_ERROR_ON(cond)
#else
/*
* XXX - workaround for http://github.com/pmem/issues/issues/189
*/
#define UT_ASSERT_COMPILE_ERROR_ON(cond)
#endif
#else
#define UT_COMPILE_ERROR_ON(cond) C_ASSERT(!(cond))
/* XXX - can't be done with C_ASSERT() unless we have __builtin_constant_p() */
#define UT_ASSERT_COMPILE_ERROR_ON(cond)
Expand Down
15 changes: 7 additions & 8 deletions src/tools/rpmemd/rpmemd_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,7 @@ rpmemd_db_check_dir_r(struct list_head *head, struct rpmemd_db *db,
const char *dir, char *pool_desc)
{
char *new_dir, *new_desc, *full_path;
struct dirent dentry;
struct dirent *result;
struct dirent *dentry;
struct pool_set *set = NULL;
DIR *dirp;
int ret = 0;
Expand All @@ -498,13 +497,13 @@ rpmemd_db_check_dir_r(struct list_head *head, struct rpmemd_db *db,
return -1;
}

while (readdir_r(dirp, &dentry, &result) == 0 && result != NULL) {
if (strcmp(dentry.d_name, ".") == 0 ||
strcmp(dentry.d_name, "..") == 0)
while ((dentry = readdir(dirp)) != NULL) {
if (strcmp(dentry->d_name, ".") == 0 ||
strcmp(dentry->d_name, "..") == 0)
continue;

if (dentry.d_type == DT_DIR) { /* directory */
if (new_paths(dir, dentry.d_name, pool_desc,
if (dentry->d_type == DT_DIR) { /* directory */
if (new_paths(dir, dentry->d_name, pool_desc,
&new_dir, &new_desc))
goto err_closedir;

Expand All @@ -519,7 +518,7 @@ rpmemd_db_check_dir_r(struct list_head *head, struct rpmemd_db *db,

}

if (new_paths(dir, dentry.d_name, pool_desc,
if (new_paths(dir, dentry->d_name, pool_desc,
&full_path, &new_desc)) {
goto err_closedir;
}
Expand Down

0 comments on commit 1c8cffc

Please sign in to comment.