/***
This file is part of systemd.
Copyright 2010-2012 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include "dirent-util.h"
#include "fd-util.h"
#include "macro.h"
#include "missing.h"
#include "stat-util.h"
#include "string-util.h"
return -errno;
}
int r;
if (follow)
else
if (r < 0)
return -errno;
}
return -errno;
}
if (!d)
return -errno;
return 0;
return 1;
}
return true;
* hence we do a simpler "is this a device node?" check. */
return true;
return false;
}
return -errno;
return null_or_empty(&st);
}
return -errno;
return null_or_empty(&st);
}
return -errno;
return true;
/* On NFS, statvfs() might not reflect whether we can actually
* write to the remote share. Let's try again with
* access(W_OK) which is more reliable, at least sometimes. */
return true;
return false;
}
char *p;
int r;
/* We use /usr/lib/os-release as flag file if something is an OS */
if (r >= 0)
return 1;
/* Also check for the old location in /etc, just in case. */
return r >= 0;
}
struct stat a, b;
return -errno;
return -errno;
}
assert(s);
}
struct statfs s;
return -errno;
return is_fs_type(&s, magic_value);
}
if (fd < 0)
return -errno;
}
return is_fs_type(s, TMPFS_MAGIC) ||
is_fs_type(s, RAMFS_MAGIC);
}
struct statfs s;
return -errno;
return is_temporary_fs(&s);
}