Loading fs_mgr/fs_mgr.c +1 −1 Original line number Diff line number Diff line Loading @@ -600,7 +600,7 @@ int fs_mgr_mount_all(struct fstab *fstab) fstab->recs[top_idx].fs_type); if (fs_mgr_is_encryptable(&fstab->recs[top_idx]) && strcmp(fstab->recs[top_idx].key_loc, KEY_IN_FOOTER)) { int fd = open(fstab->recs[top_idx].key_loc, O_WRONLY, 0644); int fd = open(fstab->recs[top_idx].key_loc, O_WRONLY); if (fd >= 0) { INFO("%s(): also wipe %s\n", __func__, fstab->recs[top_idx].key_loc); wipe_block_device(fd, get_file_size(fd)); Loading fs_mgr/fs_mgr_format.c +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ static int format_ext4(char *fs_blkdev, char *fs_mnt_point) uint64_t dev_sz; int fd, rc = 0; if ((fd = open(fs_blkdev, O_WRONLY, 0644)) < 0) { if ((fd = open(fs_blkdev, O_WRONLY)) < 0) { ERROR("Cannot open block device. %s\n", strerror(errno)); return -1; } Loading gatekeeperd/gatekeeperd.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public: void store_sid(uint32_t uid, uint64_t sid) { char filename[21]; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); int fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR); if (fd < 0) { ALOGE("could not open file: %s: %s", filename, strerror(errno)); Loading @@ -102,7 +102,7 @@ public: void maybe_store_sid(uint32_t uid, uint64_t sid) { char filename[21]; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); if (access(filename, F_OK) == -1) { store_sid(uid, sid); } Loading @@ -111,7 +111,7 @@ public: uint64_t read_sid(uint32_t uid) { char filename[21]; uint64_t sid; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); int fd = open(filename, O_RDONLY); if (fd < 0) return 0; read(fd, &sid, sizeof(sid)); Loading @@ -121,7 +121,7 @@ public: void clear_sid(uint32_t uid) { char filename[21]; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); if (remove(filename) < 0) { ALOGE("%s: could not remove file [%s], attempting 0 write", __func__, strerror(errno)); store_sid(uid, 0); Loading init/parser.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ void parse_error(struct parse_state *state, const char *fmt, ...) char buf[128]; int off; snprintf(buf, 128, "%s: %d: ", state->filename, state->line); snprintf(buf, sizeof(buf), "%s: %d: ", state->filename, state->line); buf[127] = 0; off = strlen(buf); Loading libsync/sync_test.c +2 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) for (j = 0; j < 2; j++) { unsigned val = i + j * 3 + 1; sprintf(str, "test_fence%d-%d", i, j); snprintf(str, sizeof(str), "test_fence%d-%d", i, j); int fd = sw_sync_fence_create(sync_timeline_fd, str, val); if (fd < 0) { printf("can't create sync pt %d: %s", val, strerror(errno)); Loading @@ -106,7 +106,7 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) sync_data[3].thread_no = 3; for (j = 0; j < 2; j++) { sprintf(str, "merged_fence%d", j); snprintf(str, sizeof(str), "merged_fence%d", j); sync_data[3].fd[j] = sync_merge(str, sync_data[0].fd[j], sync_data[1].fd[j]); if (sync_data[3].fd[j] < 0) { printf("can't merge sync pts %d and %d: %s\n", Loading Loading
fs_mgr/fs_mgr.c +1 −1 Original line number Diff line number Diff line Loading @@ -600,7 +600,7 @@ int fs_mgr_mount_all(struct fstab *fstab) fstab->recs[top_idx].fs_type); if (fs_mgr_is_encryptable(&fstab->recs[top_idx]) && strcmp(fstab->recs[top_idx].key_loc, KEY_IN_FOOTER)) { int fd = open(fstab->recs[top_idx].key_loc, O_WRONLY, 0644); int fd = open(fstab->recs[top_idx].key_loc, O_WRONLY); if (fd >= 0) { INFO("%s(): also wipe %s\n", __func__, fstab->recs[top_idx].key_loc); wipe_block_device(fd, get_file_size(fd)); Loading
fs_mgr/fs_mgr_format.c +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ static int format_ext4(char *fs_blkdev, char *fs_mnt_point) uint64_t dev_sz; int fd, rc = 0; if ((fd = open(fs_blkdev, O_WRONLY, 0644)) < 0) { if ((fd = open(fs_blkdev, O_WRONLY)) < 0) { ERROR("Cannot open block device. %s\n", strerror(errno)); return -1; } Loading
gatekeeperd/gatekeeperd.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -76,7 +76,7 @@ public: void store_sid(uint32_t uid, uint64_t sid) { char filename[21]; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); int fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR); if (fd < 0) { ALOGE("could not open file: %s: %s", filename, strerror(errno)); Loading @@ -102,7 +102,7 @@ public: void maybe_store_sid(uint32_t uid, uint64_t sid) { char filename[21]; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); if (access(filename, F_OK) == -1) { store_sid(uid, sid); } Loading @@ -111,7 +111,7 @@ public: uint64_t read_sid(uint32_t uid) { char filename[21]; uint64_t sid; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); int fd = open(filename, O_RDONLY); if (fd < 0) return 0; read(fd, &sid, sizeof(sid)); Loading @@ -121,7 +121,7 @@ public: void clear_sid(uint32_t uid) { char filename[21]; sprintf(filename, "%u", uid); snprintf(filename, sizeof(filename), "%u", uid); if (remove(filename) < 0) { ALOGE("%s: could not remove file [%s], attempting 0 write", __func__, strerror(errno)); store_sid(uid, 0); Loading
init/parser.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ void parse_error(struct parse_state *state, const char *fmt, ...) char buf[128]; int off; snprintf(buf, 128, "%s: %d: ", state->filename, state->line); snprintf(buf, sizeof(buf), "%s: %d: ", state->filename, state->line); buf[127] = 0; off = strlen(buf); Loading
libsync/sync_test.c +2 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) for (j = 0; j < 2; j++) { unsigned val = i + j * 3 + 1; sprintf(str, "test_fence%d-%d", i, j); snprintf(str, sizeof(str), "test_fence%d-%d", i, j); int fd = sw_sync_fence_create(sync_timeline_fd, str, val); if (fd < 0) { printf("can't create sync pt %d: %s", val, strerror(errno)); Loading @@ -106,7 +106,7 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) sync_data[3].thread_no = 3; for (j = 0; j < 2; j++) { sprintf(str, "merged_fence%d", j); snprintf(str, sizeof(str), "merged_fence%d", j); sync_data[3].fd[j] = sync_merge(str, sync_data[0].fd[j], sync_data[1].fd[j]); if (sync_data[3].fd[j] < 0) { printf("can't merge sync pts %d and %d: %s\n", Loading