• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Virtual machine Management Terminal User Interface


Commit MetaInfo

Révision3b1c48b44029ec44728339f26399cd591bc65898 (tree)
l'heure2022-07-23 14:43:40
AuteurKoine Yuusuke(koinec) <koinec@user...>
CommiterKoine Yuusuke(koinec)

Message de Log

Improve Put messages from asynchronus to synchronus for ErrInfo Window.

Change Summary

Modification

--- a/src/errinfo.c
+++ b/src/errinfo.c
@@ -95,10 +95,10 @@ int
9595 int i_remain;
9696 ErrInfo *p_now;
9797
98- if( 0 >= gi_get_remain ) { return 0; }
98+ if( 0 >= gi_get_remain ) { return -0x01; }
9999
100100 if( NULL == p_errinfo )
101- { return -0x01; }
101+ { return -0x02; }
102102
103103 pthread_mutex_lock( &gt_errmtx );
104104
@@ -189,10 +189,12 @@ int
189189 break;
190190 }
191191
192+ /*
192193 if( ERRINFO_FLAG_TUIWIN & gb_flag ) {
193194 if( gb_errlevel >= b_level )
194195 { TuiErrInfo_PrintErrInfo( p_err ); }
195196 }
197+ */
196198
197199 if( ERRINFO_FLAG_SYSLOG & gb_flag ) {
198200 if( NULL != pstr_param ) {
--- a/src/test_errinfo.c
+++ b/src/test_errinfo.c
@@ -253,6 +253,10 @@ void
253253 CU_ASSERT_STRING_EQUAL( str_msg, t_err.str_param );
254254 }
255255
256+ // Test Phase 5 ---
257+ i_err = ErrInfo_GetMessage( &t_err );
258+ CU_ASSERT( i_err == -0x01 );
259+
256260 i_err = ErrInfo_Term();
257261 CU_ASSERT( 0x00 == i_err );
258262
--- a/src/tuierrinfo.c
+++ b/src/tuierrinfo.c
@@ -76,9 +76,37 @@ int
7676 TuiErrInfo_Update(
7777 void )
7878 {
79+ int i_errs = 0;
80+ int i_remains;
81+ ErrInfo t_err;
82+ struct tm t_tm;
7983
8084 touchwin( gp_errinfo_win );
8185 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+
82110 wnoutrefresh( gp_errinfo_win );
83111
84112 return 0x00;