Loading init/init.c +0 −19 Original line number Original line Diff line number Diff line Loading @@ -25,7 +25,6 @@ #include <sys/mount.h> #include <sys/mount.h> #include <sys/stat.h> #include <sys/stat.h> #include <sys/poll.h> #include <sys/poll.h> #include <time.h> #include <errno.h> #include <errno.h> #include <stdarg.h> #include <stdarg.h> #include <mtd/mtd-user.h> #include <mtd/mtd-user.h> Loading Loading @@ -119,24 +118,6 @@ static void open_console() close(fd); close(fd); } } /* * gettime() - returns the time in seconds of the system's monotonic clock or * zero on error. */ static time_t gettime(void) { struct timespec ts; int ret; ret = clock_gettime(CLOCK_MONOTONIC, &ts); if (ret < 0) { ERROR("clock_gettime(CLOCK_MONOTONIC) failed: %s\n", strerror(errno)); return 0; } return ts.tv_sec; } static void publish_socket(const char *name, int fd) static void publish_socket(const char *name, int fd) { { char key[64] = ANDROID_SOCKET_ENV_PREFIX; char key[64] = ANDROID_SOCKET_ENV_PREFIX; Loading init/init.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ int create_socket(const char *name, int type, mode_t perm, uid_t uid, gid_t gid); uid_t uid, gid_t gid); void *read_file(const char *fn, unsigned *_sz); void *read_file(const char *fn, unsigned *_sz); time_t gettime(void); void log_init(void); void log_init(void); void log_set_level(int level); void log_set_level(int level); Loading init/util.c +19 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <fcntl.h> #include <fcntl.h> #include <ctype.h> #include <ctype.h> #include <errno.h> #include <errno.h> #include <time.h> #include <sys/stat.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/types.h> Loading Loading @@ -280,3 +281,21 @@ int mtd_name_to_number(const char *name) } } return -1; return -1; } } /* * gettime() - returns the time in seconds of the system's monotonic clock or * zero on error. */ time_t gettime(void) { struct timespec ts; int ret; ret = clock_gettime(CLOCK_MONOTONIC, &ts); if (ret < 0) { ERROR("clock_gettime(CLOCK_MONOTONIC) failed: %s\n", strerror(errno)); return 0; } return ts.tv_sec; } Loading
init/init.c +0 −19 Original line number Original line Diff line number Diff line Loading @@ -25,7 +25,6 @@ #include <sys/mount.h> #include <sys/mount.h> #include <sys/stat.h> #include <sys/stat.h> #include <sys/poll.h> #include <sys/poll.h> #include <time.h> #include <errno.h> #include <errno.h> #include <stdarg.h> #include <stdarg.h> #include <mtd/mtd-user.h> #include <mtd/mtd-user.h> Loading Loading @@ -119,24 +118,6 @@ static void open_console() close(fd); close(fd); } } /* * gettime() - returns the time in seconds of the system's monotonic clock or * zero on error. */ static time_t gettime(void) { struct timespec ts; int ret; ret = clock_gettime(CLOCK_MONOTONIC, &ts); if (ret < 0) { ERROR("clock_gettime(CLOCK_MONOTONIC) failed: %s\n", strerror(errno)); return 0; } return ts.tv_sec; } static void publish_socket(const char *name, int fd) static void publish_socket(const char *name, int fd) { { char key[64] = ANDROID_SOCKET_ENV_PREFIX; char key[64] = ANDROID_SOCKET_ENV_PREFIX; Loading
init/init.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ int create_socket(const char *name, int type, mode_t perm, uid_t uid, gid_t gid); uid_t uid, gid_t gid); void *read_file(const char *fn, unsigned *_sz); void *read_file(const char *fn, unsigned *_sz); time_t gettime(void); void log_init(void); void log_init(void); void log_set_level(int level); void log_set_level(int level); Loading
init/util.c +19 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <fcntl.h> #include <fcntl.h> #include <ctype.h> #include <ctype.h> #include <errno.h> #include <errno.h> #include <time.h> #include <sys/stat.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/types.h> Loading Loading @@ -280,3 +281,21 @@ int mtd_name_to_number(const char *name) } } return -1; return -1; } } /* * gettime() - returns the time in seconds of the system's monotonic clock or * zero on error. */ time_t gettime(void) { struct timespec ts; int ret; ret = clock_gettime(CLOCK_MONOTONIC, &ts); if (ret < 0) { ERROR("clock_gettime(CLOCK_MONOTONIC) failed: %s\n", strerror(errno)); return 0; } return ts.tv_sec; }