post-fs-data mode done

This commit is contained in:
topjohnwu
2017-05-04 01:13:04 +08:00
parent 21891230f2
commit a31c1e8084
6 changed files with 361 additions and 48 deletions

View File

@ -220,6 +220,14 @@ int xstat(const char *pathname, struct stat *buf) {
return ret;
}
int xlstat(const char *pathname, struct stat *buf) {
int ret = lstat(pathname, buf);
if (ret == -1) {
PLOGE("lstat %s", pathname);
}
return ret;
}
int xdup2(int oldfd, int newfd) {
int ret = dup2(oldfd, newfd);
if (ret == -1) {
@ -257,6 +265,22 @@ int xmount(const char *source, const char *target,
return ret;
}
int xumount(const char *target) {
int ret = umount(target);
if (ret == -1) {
PLOGE("umount %s", target);
}
return ret;
}
int xumount2(const char *target, int flags) {
int ret = umount2(target, flags);
if (ret == -1) {
PLOGE("umount2 %s", target);
}
return ret;
}
int xchmod(const char *pathname, mode_t mode) {
int ret = chmod(pathname, mode);
if (ret == -1) {