Lines Matching refs:dir
194 static void cleanup_dir(DIR *dir, mode_t mask, int depth) {
200 for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
205 if (fstatat(dirfd(dir), dent->d_name, &stats, AT_SYMLINK_NOFOLLOW) != 0)
212 dir2 = fdopendir(openat(dirfd(dir), dent->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
216 (void) unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR);
218 (void) unlinkat(dirfd(dir), dent->d_name, 0);
223 DIR *dir;
227 dir = opendir("/run/udev/data");
228 if (dir != NULL) {
229 cleanup_dir(dir, S_ISVTX, 1);
230 closedir(dir);
233 dir = opendir("/run/udev/links");
234 if (dir != NULL) {
235 cleanup_dir(dir, 0, 2);
236 closedir(dir);
239 dir = opendir("/run/udev/tags");
240 if (dir != NULL) {
241 cleanup_dir(dir, 0, 2);
242 closedir(dir);
245 dir = opendir("/run/udev/static_node-tags");
246 if (dir != NULL) {
247 cleanup_dir(dir, 0, 2);
248 closedir(dir);
251 dir = opendir("/run/udev/watch");
252 if (dir != NULL) {
253 cleanup_dir(dir, 0, 1);
254 closedir(dir);