Lines Matching full:path
40 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) {
41 // Check if path needs to be created
43 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) {
47 ALOGE("Failed to lstat(%s): %s", path, strerror(errno));
54 ALOGE("Not a directory: %s", path);
64 if (TEMP_FAILURE_RETRY(mkdir(path, mode)) == -1) {
66 ALOGE("Failed to mkdir(%s): %s", path, strerror(errno));
72 if (TEMP_FAILURE_RETRY(chmod(path, mode)) == -1) {
73 ALOGE("Failed to chmod(%s, %d): %s", path, mode, strerror(errno));
76 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) {
77 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno));
84 int fs_read_atomic_int(const char* path, int* out_value) {
85 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY));
87 ALOGE("Failed to read %s: %s", path, strerror(errno));
93 ALOGE("Failed to read %s: %s", path, strerror(errno));
97 ALOGE("Failed to parse %s: %s", path, strerror(errno));
109 int fs_write_atomic_int(const char* path, int value) {
111 if (snprintf(temp, PATH_MAX, "%s.XXXXXX", path) >= PATH_MAX) {
112 ALOGE("Path too long");
137 if (rename(temp, path) == -1) {
138 ALOGE("Failed to rename %s to %s: %s", temp, path, strerror(errno));
153 int fs_mkdirs(const char* path, mode_t mode) {
157 char* buf = strdup(path);
178 ALOGE("Invalid path: %s", buf);