Simplify skipping "." and ".." in switch_root

This commit is contained in:
sin 2014-04-14 11:32:30 +01:00
parent 33be4f39c2
commit bed72cf409

View File

@ -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 */