am 8f98c4b5: Merge "Fix dirfd crash issue in property service"
* commit '8f98c4b5f011db8637ce1b9361e82d59b13434f4': Fix dirfd crash issue in property service
This commit is contained in:
commit
6575a1625a
1 changed files with 2 additions and 1 deletions
|
|
@ -512,13 +512,14 @@ static void load_properties_from_file(const char *fn)
|
||||||
static void load_persistent_properties()
|
static void load_persistent_properties()
|
||||||
{
|
{
|
||||||
DIR* dir = opendir(PERSISTENT_PROPERTY_DIR);
|
DIR* dir = opendir(PERSISTENT_PROPERTY_DIR);
|
||||||
int dir_fd = dirfd(dir);
|
int dir_fd;
|
||||||
struct dirent* entry;
|
struct dirent* entry;
|
||||||
char value[PROP_VALUE_MAX];
|
char value[PROP_VALUE_MAX];
|
||||||
int fd, length;
|
int fd, length;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
if (dir) {
|
if (dir) {
|
||||||
|
dir_fd = dirfd(dir);
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
if (strncmp("persist.", entry->d_name, strlen("persist.")))
|
if (strncmp("persist.", entry->d_name, strlen("persist.")))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue