Virtual machine Management Terminal User Interface
Révision | 3b1c48b44029ec44728339f26399cd591bc65898 (tree) |
---|---|
l'heure | 2022-07-23 14:43:40 |
Auteur | Koine Yuusuke(koinec) <koinec@user...> |
Commiter | Koine Yuusuke(koinec) |
Improve Put messages from asynchronus to synchronus for ErrInfo Window.
@@ -95,10 +95,10 @@ int | ||
95 | 95 | int i_remain; |
96 | 96 | ErrInfo *p_now; |
97 | 97 | |
98 | - if( 0 >= gi_get_remain ) { return 0; } | |
98 | + if( 0 >= gi_get_remain ) { return -0x01; } | |
99 | 99 | |
100 | 100 | if( NULL == p_errinfo ) |
101 | - { return -0x01; } | |
101 | + { return -0x02; } | |
102 | 102 | |
103 | 103 | pthread_mutex_lock( >_errmtx ); |
104 | 104 |
@@ -189,10 +189,12 @@ int | ||
189 | 189 | break; |
190 | 190 | } |
191 | 191 | |
192 | + /* | |
192 | 193 | if( ERRINFO_FLAG_TUIWIN & gb_flag ) { |
193 | 194 | if( gb_errlevel >= b_level ) |
194 | 195 | { TuiErrInfo_PrintErrInfo( p_err ); } |
195 | 196 | } |
197 | + */ | |
196 | 198 | |
197 | 199 | if( ERRINFO_FLAG_SYSLOG & gb_flag ) { |
198 | 200 | if( NULL != pstr_param ) { |
@@ -253,6 +253,10 @@ void | ||
253 | 253 | CU_ASSERT_STRING_EQUAL( str_msg, t_err.str_param ); |
254 | 254 | } |
255 | 255 | |
256 | + // Test Phase 5 --- | |
257 | + i_err = ErrInfo_GetMessage( &t_err ); | |
258 | + CU_ASSERT( i_err == -0x01 ); | |
259 | + | |
256 | 260 | i_err = ErrInfo_Term(); |
257 | 261 | CU_ASSERT( 0x00 == i_err ); |
258 | 262 |
@@ -76,9 +76,37 @@ int | ||
76 | 76 | TuiErrInfo_Update( |
77 | 77 | void ) |
78 | 78 | { |
79 | + int i_errs = 0; | |
80 | + int i_remains; | |
81 | + ErrInfo t_err; | |
82 | + struct tm t_tm; | |
79 | 83 | |
80 | 84 | touchwin( gp_errinfo_win ); |
81 | 85 | touchwin( gp_errinfo_subwin ); |
86 | + | |
87 | + while((256 > i_errs++) && ( 0 <= ErrInfo_GetMessage( &t_err ))) { | |
88 | + localtime_r( &(t_err.t_errtime), &t_tm ); | |
89 | + | |
90 | + if( '\0' != t_err.str_param[0] ) { | |
91 | + wprintw( gp_errinfo_subwin, | |
92 | + " %04d/%02d/%02d %02d:%02d:%02d %s: %s errno=%2d <H:%2d,G:%2d,Rq:%2d> (%d : %s) [%s:%3d]\n", | |
93 | + (t_tm.tm_year + 1900), t_tm.tm_mon, t_tm.tm_mday, t_tm.tm_hour, t_tm.tm_min, t_tm.tm_sec, | |
94 | + t_err.str_level, t_err.str_errormsg, t_err.i_errno, | |
95 | + t_err.i_hvisor, t_err.i_guest, t_err.i_request, | |
96 | + t_err.i_param, t_err.str_param, | |
97 | + t_err.str_srcfile, t_err.i_srcline); | |
98 | + } | |
99 | + else { | |
100 | + wprintw( gp_errinfo_subwin, | |
101 | + " %04d/%02d/%02d %02d:%02d:%02d %s: %s errno=%2d <H:%2d,G:%2d,Rq:%2d> (%d) [%s:%3d]\n", | |
102 | + (t_tm.tm_year + 1900), t_tm.tm_mon, t_tm.tm_mday, t_tm.tm_hour, t_tm.tm_min, t_tm.tm_sec, | |
103 | + t_err.str_level, t_err.str_errormsg, t_err.i_errno, | |
104 | + t_err.i_hvisor, t_err.i_guest, t_err.i_request, | |
105 | + t_err.i_param, | |
106 | + t_err.str_srcfile, t_err.i_srcline); | |
107 | + } | |
108 | + } | |
109 | + | |
82 | 110 | wnoutrefresh( gp_errinfo_win ); |
83 | 111 | |
84 | 112 | return 0x00; |