Merge "Remove fs_config_generate()"
am: 45f79b1c3b
Change-Id: I5bef71ab65fd45daa94fc16aebb2d8258ce9b275
This commit is contained in:
commit
b9ef822307
2 changed files with 0 additions and 20 deletions
|
|
@ -379,21 +379,3 @@ void fs_config(const char* path, int dir, const char* target_out_path, unsigned*
|
||||||
*mode = (*mode & (~07777)) | pc->mode;
|
*mode = (*mode & (~07777)) | pc->mode;
|
||||||
*capabilities = pc->capabilities;
|
*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;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,6 @@ __BEGIN_DECLS
|
||||||
void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid,
|
void fs_config(const char* path, int dir, const char* target_out_path, unsigned* uid, unsigned* gid,
|
||||||
unsigned* mode, uint64_t* capabilities);
|
unsigned* mode, uint64_t* capabilities);
|
||||||
|
|
||||||
ssize_t fs_config_generate(char* buffer, size_t length, const struct fs_path_config* pc);
|
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
#endif /* _LIBS_CUTILS_PRIVATE_FS_CONFIG_H */
|
#endif /* _LIBS_CUTILS_PRIVATE_FS_CONFIG_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue