From 55fe01db6921297d3b0f7b40c34c8624b9fb3491 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Mon, 17 Jun 2019 13:40:31 -0700 Subject: [PATCH] Remove fs_config_generate() We replaced creating the binary fs_config files with a python script (/build/make/tools/fs_config/fs_config_generator.py), so there are no more users of this function, nor do we plan for there to be. Test: build Change-Id: I49ec7e3d22c206bc250cbda6f66a4a59e47030e9 --- libcutils/fs_config.cpp | 18 ------------------ libcutils/include/private/fs_config.h | 2 -- 2 files changed, 20 deletions(-) diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp index 660603062..06a9cd13f 100644 --- a/libcutils/fs_config.cpp +++ b/libcutils/fs_config.cpp @@ -379,21 +379,3 @@ void fs_config(const char* path, int dir, const char* target_out_path, unsigned* *mode = (*mode & (~07777)) | pc->mode; *capabilities = pc->capabilities; } - -ssize_t fs_config_generate(char* buffer, size_t length, const struct fs_path_config* pc) { - struct fs_path_config_from_file* p = (struct fs_path_config_from_file*)buffer; - size_t len = ALIGN(sizeof(*p) + strlen(pc->prefix) + 1, sizeof(uint64_t)); - - if ((length < len) || (len > UINT16_MAX)) { - return -ENOSPC; - } - memset(p, 0, len); - uint16_t host_len = len; - p->len = get2LE((const uint8_t*)&host_len); - p->mode = get2LE((const uint8_t*)&(pc->mode)); - p->uid = get2LE((const uint8_t*)&(pc->uid)); - p->gid = get2LE((const uint8_t*)&(pc->gid)); - p->capabilities = get8LE((const uint8_t*)&(pc->capabilities)); - strcpy(p->prefix, pc->prefix); - return len; -} diff --git a/libcutils/include/private/fs_config.h b/libcutils/include/private/fs_config.h index 892649187..603cf1a6a 100644 --- a/libcutils/include/private/fs_config.h +++ b/libcutils/include/private/fs_config.h @@ -74,8 +74,6 @@ __BEGIN_DECLS void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid, unsigned* mode, uint64_t* capabilities); -ssize_t fs_config_generate(char* buffer, size_t length, const struct fs_path_config* pc); - __END_DECLS #endif /* _LIBS_CUTILS_PRIVATE_FS_CONFIG_H */