dirent-util.c revision a09561746f15b84da9471b5c4be74e53d19e4f3f
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering This file is part of systemd.
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering Copyright 2010-2012 Lennart Poettering
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering systemd is free software; you can redistribute it and/or modify it
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering under the terms of the GNU Lesser General Public License as published by
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering (at your option) any later version.
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering systemd is distributed in the hope that it will be useful, but
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering Lesser General Public License for more details.
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering You should have received a copy of the GNU Lesser General Public License
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poetteringint dirent_ensure_type(DIR *d, struct dirent *de) {
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poettering if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0)
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poetteringbool dirent_is_file(const struct dirent *de) {
a09561746f15b84da9471b5c4be74e53d19e4f3fLennart Poetteringbool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {