am 705accc2: Merge "Init: Remove unused variables"
* commit '705accc2a3e3ab29308454212a6029821426ef4e': Init: Remove unused variables
This commit is contained in:
commit
45f2b924b6
6 changed files with 9 additions and 30 deletions
|
|
@ -501,7 +501,6 @@ int do_mount_all(int nargs, char **args)
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int child_ret = -1;
|
int child_ret = -1;
|
||||||
int status;
|
int status;
|
||||||
const char *prop;
|
|
||||||
struct fstab *fstab;
|
struct fstab *fstab;
|
||||||
|
|
||||||
if (nargs != 2) {
|
if (nargs != 2) {
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,6 @@ static bool perm_path_matches(const char *path, struct perms_ *dp)
|
||||||
static mode_t get_device_perm(const char *path, const char **links,
|
static mode_t get_device_perm(const char *path, const char **links,
|
||||||
unsigned *uid, unsigned *gid)
|
unsigned *uid, unsigned *gid)
|
||||||
{
|
{
|
||||||
mode_t perm;
|
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct perm_node *perm_node;
|
struct perm_node *perm_node;
|
||||||
struct perms_ *dp;
|
struct perms_ *dp;
|
||||||
|
|
@ -497,15 +496,10 @@ static char **get_block_device_symlinks(struct uevent *uevent)
|
||||||
struct platform_node *pdev;
|
struct platform_node *pdev;
|
||||||
char *slash;
|
char *slash;
|
||||||
const char *type;
|
const char *type;
|
||||||
int width;
|
|
||||||
char buf[256];
|
char buf[256];
|
||||||
char link_path[256];
|
char link_path[256];
|
||||||
int fd;
|
|
||||||
int link_num = 0;
|
int link_num = 0;
|
||||||
int ret;
|
|
||||||
char *p;
|
char *p;
|
||||||
unsigned int size;
|
|
||||||
struct stat info;
|
|
||||||
|
|
||||||
pdev = find_platform_device(uevent->path);
|
pdev = find_platform_device(uevent->path);
|
||||||
if (pdev) {
|
if (pdev) {
|
||||||
|
|
@ -926,7 +920,6 @@ root_free_out:
|
||||||
static void handle_firmware_event(struct uevent *uevent)
|
static void handle_firmware_event(struct uevent *uevent)
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if(strcmp(uevent->subsystem, "firmware"))
|
if(strcmp(uevent->subsystem, "firmware"))
|
||||||
return;
|
return;
|
||||||
|
|
@ -1045,15 +1038,18 @@ void device_init(void)
|
||||||
fcntl(device_fd, F_SETFD, FD_CLOEXEC);
|
fcntl(device_fd, F_SETFD, FD_CLOEXEC);
|
||||||
fcntl(device_fd, F_SETFL, O_NONBLOCK);
|
fcntl(device_fd, F_SETFL, O_NONBLOCK);
|
||||||
|
|
||||||
if (stat(coldboot_done, &info) < 0) {
|
if (stat(COLDBOOT_DONE, &info) < 0) {
|
||||||
t0 = get_usecs();
|
t0 = get_usecs();
|
||||||
coldboot("/sys/class");
|
coldboot("/sys/class");
|
||||||
coldboot("/sys/block");
|
coldboot("/sys/block");
|
||||||
coldboot("/sys/devices");
|
coldboot("/sys/devices");
|
||||||
t1 = get_usecs();
|
t1 = get_usecs();
|
||||||
fd = open(coldboot_done, O_WRONLY|O_CREAT, 0000);
|
fd = open(COLDBOOT_DONE, O_WRONLY|O_CREAT, 0000);
|
||||||
close(fd);
|
close(fd);
|
||||||
log_event_print("coldboot %ld uS\n", ((long) (t1 - t0)));
|
log_event_print("coldboot %ld uS\n", ((long) (t1 - t0)));
|
||||||
|
// t0 & t1 are unused if the log isn't doing anything.
|
||||||
|
(void)t0;
|
||||||
|
(void)t1;
|
||||||
} else {
|
} else {
|
||||||
log_event_print("skipping coldboot, already done\n");
|
log_event_print("skipping coldboot, already done\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
init/init.c
11
init/init.c
|
|
@ -76,7 +76,6 @@ static char qemu[32];
|
||||||
|
|
||||||
static struct action *cur_action = NULL;
|
static struct action *cur_action = NULL;
|
||||||
static struct command *cur_command = NULL;
|
static struct command *cur_command = NULL;
|
||||||
static struct listnode *command_queue = NULL;
|
|
||||||
|
|
||||||
void notify_service_state(const char *name, const char *state)
|
void notify_service_state(const char *name, const char *state)
|
||||||
{
|
{
|
||||||
|
|
@ -170,7 +169,6 @@ void service_start(struct service *svc, const char *dynamic_args)
|
||||||
struct stat s;
|
struct stat s;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int needs_console;
|
int needs_console;
|
||||||
int n;
|
|
||||||
char *scon = NULL;
|
char *scon = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
|
@ -578,10 +576,10 @@ void execute_one_command(void)
|
||||||
static int wait_for_coldboot_done_action(int nargs, char **args)
|
static int wait_for_coldboot_done_action(int nargs, char **args)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
INFO("wait for %s\n", coldboot_done);
|
INFO("wait for %s\n", COLDBOOT_DONE);
|
||||||
ret = wait_for_file(coldboot_done, COMMAND_RETRY_TIMEOUT);
|
ret = wait_for_file(COLDBOOT_DONE, COMMAND_RETRY_TIMEOUT);
|
||||||
if (ret)
|
if (ret)
|
||||||
ERROR("Timed out waiting for %s\n", coldboot_done);
|
ERROR("Timed out waiting for %s\n", COLDBOOT_DONE);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1003,9 +1001,6 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int fd_count = 0;
|
int fd_count = 0;
|
||||||
struct pollfd ufds[4];
|
struct pollfd ufds[4];
|
||||||
char *tmpdev;
|
|
||||||
char* debuggable;
|
|
||||||
char tmp[32];
|
|
||||||
int property_set_fd_init = 0;
|
int property_set_fd_init = 0;
|
||||||
int signal_fd_init = 0;
|
int signal_fd_init = 0;
|
||||||
int keychord_fd_init = 0;
|
int keychord_fd_init = 0;
|
||||||
|
|
|
||||||
|
|
@ -187,19 +187,14 @@ static int push_chars(char **dst, int *len, const char *chars, int cnt)
|
||||||
|
|
||||||
int expand_props(char *dst, const char *src, int dst_size)
|
int expand_props(char *dst, const char *src, int dst_size)
|
||||||
{
|
{
|
||||||
int cnt = 0;
|
|
||||||
char *dst_ptr = dst;
|
char *dst_ptr = dst;
|
||||||
const char *src_ptr = src;
|
const char *src_ptr = src;
|
||||||
int src_len;
|
|
||||||
int idx = 0;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int left = dst_size - 1;
|
int left = dst_size - 1;
|
||||||
|
|
||||||
if (!src || !dst || dst_size == 0)
|
if (!src || !dst || dst_size == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
src_len = strlen(src);
|
|
||||||
|
|
||||||
/* - variables can either be $x.y or ${x.y}, in case they are only part
|
/* - variables can either be $x.y or ${x.y}, in case they are only part
|
||||||
* of the string.
|
* of the string.
|
||||||
* - will accept $$ as a literal $.
|
* - will accept $$ as a literal $.
|
||||||
|
|
@ -847,7 +842,6 @@ static void parse_line_action(struct parse_state* state, int nargs, char **args)
|
||||||
{
|
{
|
||||||
struct command *cmd;
|
struct command *cmd;
|
||||||
struct action *act = state->context;
|
struct action *act = state->context;
|
||||||
int (*func)(int nargs, char **args);
|
|
||||||
int kw, n;
|
int kw, n;
|
||||||
|
|
||||||
if (nargs == 0) {
|
if (nargs == 0) {
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ typedef struct {
|
||||||
|
|
||||||
static int init_workspace(workspace *w, size_t size)
|
static int init_workspace(workspace *w, size_t size)
|
||||||
{
|
{
|
||||||
void *data;
|
|
||||||
int fd = open(PROP_FILENAME, O_RDONLY | O_NOFOLLOW);
|
int fd = open(PROP_FILENAME, O_RDONLY | O_NOFOLLOW);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -142,9 +141,6 @@ static int check_control_mac_perms(const char *name, char *sctx)
|
||||||
*/
|
*/
|
||||||
static int check_perms(const char *name, char *sctx)
|
static int check_perms(const char *name, char *sctx)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
unsigned int app_id;
|
|
||||||
|
|
||||||
if(!strncmp(name, "ro.", 3))
|
if(!strncmp(name, "ro.", 3))
|
||||||
name +=3;
|
name +=3;
|
||||||
|
|
||||||
|
|
@ -261,7 +257,6 @@ void handle_property_set_fd()
|
||||||
prop_msg msg;
|
prop_msg msg;
|
||||||
int s;
|
int s;
|
||||||
int r;
|
int r;
|
||||||
int res;
|
|
||||||
struct ucred cr;
|
struct ucred cr;
|
||||||
struct sockaddr_un addr;
|
struct sockaddr_un addr;
|
||||||
socklen_t addr_size = sizeof(addr);
|
socklen_t addr_size = sizeof(addr);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
|
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
|
||||||
|
|
||||||
static const char *coldboot_done = "/dev/.coldboot_done";
|
#define COLDBOOT_DONE "/dev/.coldboot_done"
|
||||||
|
|
||||||
int mtd_name_to_number(const char *name);
|
int mtd_name_to_number(const char *name);
|
||||||
int create_socket(const char *name, int type, mode_t perm,
|
int create_socket(const char *name, int type, mode_t perm,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue