diff options
| -rw-r--r-- | include/private/android_filesystem_config.h | 3 | ||||
| -rw-r--r-- | libcutils/fs.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index 6521cbe7..33ecd9a6 100644 --- a/include/private/android_filesystem_config.h +++ b/include/private/android_filesystem_config.h @@ -87,6 +87,9 @@ #define AID_USER 100000 /* offset for uid ranges for each user */ +#define AID_SHARED_GID_START 50000 /* start of gids for apps in each user to share */ +#define AID_SHARED_GID_END 59999 /* start of gids for apps in each user to share */ + #if !defined(EXCLUDE_FS_CONFIG_STRUCTURES) struct android_id_info { const char *name; diff --git a/libcutils/fs.c b/libcutils/fs.c index 6508b678..a9889b2b 100644 --- a/libcutils/fs.c +++ b/libcutils/fs.c @@ -73,14 +73,14 @@ fixup: } int fs_read_atomic_int(const char* path, int* out_value) { - int fd = open(path, O_RDONLY); + int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY)); if (fd == -1) { ALOGE("Failed to read %s: %s", path, strerror(errno)); return -1; } char buf[BUF_SIZE]; - if (read(fd, buf, BUF_SIZE) == -1) { + if (TEMP_FAILURE_RETRY(read(fd, buf, BUF_SIZE)) == -1) { ALOGE("Failed to read %s: %s", path, strerror(errno)); goto fail; } @@ -104,7 +104,7 @@ int fs_write_atomic_int(const char* path, int value) { return -1; } - int fd = mkstemp(temp); + int fd = TEMP_FAILURE_RETRY(mkstemp(temp)); if (fd == -1) { ALOGE("Failed to open %s: %s", temp, strerror(errno)); return -1; @@ -116,7 +116,7 @@ int fs_write_atomic_int(const char* path, int value) { ALOGE("Value %d too large: %s", value, strerror(errno)); goto fail; } - if (write(fd, buf, len) < len) { + if (TEMP_FAILURE_RETRY(write(fd, buf, len)) < len) { ALOGE("Failed to write %s: %s", temp, strerror(errno)); goto fail; } |
