commit bed72cf4090767585724ef77fc7efa978c88bd6d parent 33be4f39c27a81dd797f1a5e94a5145f02da7340 Author: sin <sin@2f30.org> Date: Mon, 14 Apr 2014 11:32:30 +0100 Simplify skipping "." and ".." in switch_root Diffstat:
M | switch_root.c | | | 5 | ++--- |
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/switch_root.c b/switch_root.c @@ -28,9 +28,8 @@ delete_content(const char *dir, dev_t curdevice) if (d) { for(; (dent = readdir(d)) ;) { /* skip ".." and "." */ - if (dent->d_name[0] == '.' - && ((dent->d_name[1] == '.' && dent->d_name[2] == 0) - || (dent->d_name[1] == 0))) + if (strcmp(dent->d_name, ".") == 0 || + strcmp(dent->d_name, "..") == 0) continue; /* build path and dive deeper */