Permalink
Browse files

Merge "Fix dirfd crash issue in property service"

  • Loading branch information...
2 parents 3e5e9e9 + e41bc31 commit 8f98c4b5f011db8637ce1b9361e82d59b13434f4 @nickkral nickkral committed with Gerrit Code Review Oct 23, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 init/property_service.c
View
@@ -510,13 +510,14 @@ static void load_properties_from_file(const char *fn)
static void load_persistent_properties()
{
DIR* dir = opendir(PERSISTENT_PROPERTY_DIR);
- int dir_fd = dirfd(dir);
+ int dir_fd;
struct dirent* entry;
char value[PROP_VALUE_MAX];
int fd, length;
struct stat sb;
if (dir) {
+ dir_fd = dirfd(dir);
while ((entry = readdir(dir)) != NULL) {
if (strncmp("persist.", entry->d_name, strlen("persist.")))
continue;

0 comments on commit 8f98c4b

Please sign in to comment.