Simplify skipping "." and ".." in switch_root
This commit is contained in:
parent
33be4f39c2
commit
bed72cf409
|
@ -28,9 +28,8 @@ delete_content(const char *dir, dev_t curdevice)
|
||||||
if (d) {
|
if (d) {
|
||||||
for(; (dent = readdir(d)) ;) {
|
for(; (dent = readdir(d)) ;) {
|
||||||
/* skip ".." and "." */
|
/* skip ".." and "." */
|
||||||
if (dent->d_name[0] == '.'
|
if (strcmp(dent->d_name, ".") == 0 ||
|
||||||
&& ((dent->d_name[1] == '.' && dent->d_name[2] == 0)
|
strcmp(dent->d_name, "..") == 0)
|
||||||
|| (dent->d_name[1] == 0)))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* build path and dive deeper */
|
/* build path and dive deeper */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user