This repository was archived by the owner on Feb 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -620,6 +620,7 @@ static int hyper_start_pod(char *json, int length)
620620 if (pod -> init_pid )
621621 fprintf (stdout , "pod init_pid exist %d\n" , pod -> init_pid );
622622
623+ hyper_sync_time_hctosys ();
623624 if (hyper_parse_pod (pod , json , length ) < 0 ) {
624625 fprintf (stderr , "parse pod json failed\n" );
625626 return -1 ;
Original file line number Diff line number Diff line change @@ -99,6 +99,18 @@ int hyper_copy_dir(char *src, char *dest) {
9999 return -1 ;
100100}
101101
102+ void hyper_sync_time_hctosys () {
103+ int pid ;
104+ pid = fork ();
105+ if (pid < 0 ) {
106+ perror ("fail to fork to copy directory" );
107+ } else if (pid == 0 ) {
108+ execlp ("/busybox" , "hwclock" , "-s" , NULL );
109+ perror ("exec hwclock -s command failed" );
110+ exit (-1 );
111+ }
112+ }
113+
102114int hyper_find_sd (char * addr , char * * dev ) {
103115 struct dirent * * list ;
104116 struct dirent * dir ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ int hyper_setup_env(struct env *envs, int num);
1919int hyper_find_sd (char * addr , char * * dev );
2020int hyper_list_dir (char * path );
2121int hyper_copy_dir (char * src , char * dst );
22+ void hyper_sync_time_hctosys ();
2223void online_cpu (void );
2324void online_memory (void );
2425int hyper_mkdir (char * path );
You can’t perform that action at this time.
0 commit comments