Lines Matching refs:path
33 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) {
34 // Check if path needs to be created
36 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) {
40 ALOGE("Failed to lstat(%s): %s", path, strerror(errno));
47 ALOGE("Not a directory: %s", path);
57 if (TEMP_FAILURE_RETRY(mkdir(path, mode)) == -1) {
59 ALOGE("Failed to mkdir(%s): %s", path, strerror(errno));
65 if (TEMP_FAILURE_RETRY(chmod(path, mode)) == -1) {
66 ALOGE("Failed to chmod(%s, %d): %s", path, mode, strerror(errno));
69 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) {
70 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno));
77 int fs_read_atomic_int(const char* path, int* out_value) {
78 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY));
80 ALOGE("Failed to read %s: %s", path, strerror(errno));
86 ALOGE("Failed to read %s: %s", path, strerror(errno));
90 ALOGE("Failed to parse %s: %s", path, strerror(errno));
102 int fs_write_atomic_int(const char* path, int value) {
104 if (snprintf(temp, PATH_MAX, "%s.XXXXXX", path) >= PATH_MAX) {
130 if (rename(temp, path) == -1) {
131 ALOGE("Failed to rename %s to %s: %s", temp, path, strerror(errno));