diff options
author | Pierre Willenbrock <pierre@pirsoft.de> | 2008-12-15 09:08:30 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2008-12-15 09:08:30 +0800 |
commit | d917583c19e2eb20a559eddaa100ce71d8fbe48c (patch) | |
tree | 0c568ab640b0d39c062933f14440ff7fe389f854 /src/i830_lvds.c | |
parent | 865735d8408ee6b75be8fb1a8ab32b2a53dd3adb (diff) |
closedir only after finishing use of any results from readdir
Diffstat (limited to 'src/i830_lvds.c')
-rw-r--r-- | src/i830_lvds.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c index b1bf6eee..c6002ebd 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -422,7 +422,6 @@ i830_lvds_acpi_lid_open(xf86OutputPtr output) } if (strcmp(lid_dent->d_name, ".") && strcmp(lid_dent->d_name, "..")) { - closedir(lid_dir); break; } } @@ -432,6 +431,8 @@ i830_lvds_acpi_lid_open(xf86OutputPtr output) strcat(state_name, lid_dent->d_name); strcat(state_name, "/state"); + closedir(lid_dir); + if ((fd = open(state_name, O_RDONLY)) == -1) { free(state_name); goto out; |