• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Virtual machine Management Terminal User Interface


Commit MetaInfo

Revisión50b2e09d722b08e7afe48c362605b0d1e89d6780 (tree)
Tiempo2023-05-06 22:05:00
AutorKoine Yuusuke(koinec) <koinec@user...>
CommiterKoine Yuusuke(koinec)

Log Message

Fix build error on FreeBSD 13.2-RELEASE.

Cambiar Resumen

Diferencia incremental

--- a/src/conffile.c
+++ b/src/conffile.c
@@ -58,8 +58,7 @@ int
5858
5959
6060 /* ===========================================================================*/
61-VMTUI_CONFFILE_EXTERN
62-int
61+void
6362 ConfFile_RegistValue(
6463 KeyVal_Info *pt_info,
6564 char *pstr_key,
@@ -127,7 +126,7 @@ int
127126 errno, 0, 0x00, str_temp );
128127 }
129128
130- return 0x00;
129+ return;
131130 }
132131
133132 /* ===========================================================================*/
@@ -143,7 +142,6 @@ int
143142 int i_max_idcounter )
144143 {
145144 int i_cnt;
146- int i_err;
147145 int i_ret;
148146 int i_keylen;
149147 int i_vallen;
@@ -232,7 +230,7 @@ int
232230 pt_base->pstr_keyval_base_key,
233231 i_keyid, pt_sub->pstr_keyval_sub_key );
234232
235- i_err = ConfFile_RegistValue(
233+ ConfFile_RegistValue(
236234 pt_info, str_key, pstr_value, i_vallen,
237235 pt_sub->b_type, pt_sub->dw_keyval_priority,
238236 pt_sub->pf_valcheck );
@@ -258,7 +256,7 @@ int
258256 while( CONFFILE_TYPE_TERMINATER != pt_normal->b_type ) {
259257
260258 if( 0x00 == strncmp( pstr_key, pt_normal->pstr_cfg_key, i_keylen ) ) {
261- i_err = ConfFile_RegistValue(
259+ ConfFile_RegistValue(
262260 pt_info, pt_normal->pstr_keyval_key,
263261 pstr_value, i_vallen, pt_normal->b_type,
264262 pt_normal->dw_keyval_priority, pt_normal->pf_valcheck );
--- a/src/conffile.h
+++ b/src/conffile.h
@@ -84,13 +84,16 @@ typedef struct {
8484 #endif
8585 VMTUI_CONFFILE_EXTERN int ConfFile_ValCheck_SelectItem(
8686 char *pstr_key, char *pstr_value, int i_vallen, ConfFile_SelectValue *pt_selval );
87-VMTUI_CONFFILE_EXTERN int ConfFile_RegistValue(
88- KeyVal_Info *pt_info, char *pstr_key, char *pstr_value, int i_vallen,
89- Byte b_type, DWord dw_priority, ConfFile_CheckValue pf_valcheck );
9087 VMTUI_CONFFILE_EXTERN int ConfFile_ParseConfig(
9188 KeyVal_Info *pt_info, int *pi_idcounter, char *pstr_buf, int i_buflen,
9289 ConfFile_KeyTbl *pt_normal, ConfFile_BaseKeyTbl *pt_base, int i_max_idcounter );
9390
91+#ifdef VMTUI_SRC_CONFFILE
92+void ConfFile_RegistValue(
93+ KeyVal_Info *pt_info, char *pstr_key, char *pstr_value, int i_vallen,
94+ Byte b_type, DWord dw_priority, ConfFile_CheckValue pf_valcheck );
95+#endif
96+
9497 #endif
9598
9699 /* EOF of @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
--- a/src/guest.c
+++ b/src/guest.c
@@ -364,7 +364,6 @@ int
364364
365365 int i_cnt;
366366 Guest *p_guest;
367- Guest *p_prev;
368367
369368 // Create Index ---
370369 gpp_guestindex = (Guest **)malloc( sizeof( Guest * ) * GUEST_ALLOC_UNITS );
@@ -391,7 +390,6 @@ int
391390 pthread_rwlock_init( &gt_guest_rwlock, NULL );
392391
393392 // Clear All Guest structs. ---
394- p_prev = NULL;
395393 for( i_cnt = (gi_alloc_guest - 1); 0 <= i_cnt ; i_cnt-- ) {
396394 p_guest = GuestPtr(i_cnt);
397395
--- a/src/guestconfig.c
+++ b/src/guestconfig.c
@@ -93,7 +93,9 @@ int
9393 i_err = ConfFile_ParseConfig(
9494 &(p_guest->t_info), i_idcounter, pstr_buf, i_buflen,
9595 lt_cfg_normaltbl, lt_cfg_basetbl, GUESTCONFIG_CNTID_MAX );
96-
96+ if( 0x00 != i_err ) {
97+ return -0x01;
98+ }
9799
98100 for( i_cnt = 0; i_cnt < GUESTCONFIG_CNTID_MAX; i_cnt++ ) {
99101 if( -1 < i_idcounter[i_cnt] ) {
--- a/src/hvcmd.c
+++ b/src/hvcmd.c
@@ -43,7 +43,6 @@ int
4343 DWord dw_status;
4444 DWord dw_hvoption;
4545 Byte b_connection;
46- Byte b_sshtype;
4746 Byte b_nosshpasswd = 0x00;
4847 Byte b_nosudopasswd = 0x00;
4948
@@ -51,7 +50,6 @@ int
5150 p_hvisor = HVisor_Ref( i_hvisor );
5251 dw_status = p_hvisor->dw_status;
5352 b_connection = p_hvisor->b_connection;
54- b_sshtype = p_hvisor->ssh.b_sshtype;
5553 if(( HVISOR_OPTION_SSH_PASSWORD & p_hvisor->dw_option )
5654 && ( p_hvisor->ssh.str_password[0] == '\0' ))
5755 { b_nosshpasswd = 0x01; }
--- a/src/keyval.c
+++ b/src/keyval.c
@@ -90,7 +90,6 @@ int
9090 KeyVal_Item *p_parent;
9191 KeyVal_Item *p_now;
9292 KeyVal_Item *p_prev = NULL;
93- KeyVal_Item *p_next = NULL;
9493
9594 p_item = p_kvinfo->p_items + i_item;
9695 assert( NULL != p_item );
@@ -128,8 +127,6 @@ int
128127 i_now = p_now->i_next;
129128 }
130129
131- if( KEYVAL_NONEID != i_now ) { p_next = p_now; }
132-
133130 if( KEYVAL_NONEID != i_parent ) {
134131 if( KEYVAL_NONEID == p_parent->i_child )
135132 { p_parent->i_child = i_item; }
@@ -160,15 +157,12 @@ int
160157 KeyVal_Item *p_item;
161158 KeyVal_Item *p_prev = NULL;
162159 KeyVal_Item *p_parent = NULL;
163- int i_parent;
164160 int i_now;
165161
166162 p_item = p_kvinfo->p_items + i_item;
167163 assert( NULL != p_item );
168164 assert( KEYVAL_NONEID == p_item->i_child );
169165
170- i_parent = p_item->i_parent;
171-
172166 if( KEYVAL_NONEID != p_item->i_parent ) {
173167 p_parent = p_kvinfo->p_items + (p_item->i_parent);
174168 assert( NULL != p_parent );
--- a/src/tuicmd.h
+++ b/src/tuicmd.h
@@ -43,8 +43,7 @@ VMTUI_TUICMD_EXTERN int TuiCmd_Term( void );
4343 #ifdef VMTUI_SRC_TUICMD
4444 WINDOW *gp_cmd_win = NULL;
4545 #else
46-WINDOW *gp_cmd_win;
47-
46+extern WINDOW *gp_cmd_win;
4847 #endif
4948
5049 #endif
--- a/src/tuiguest.c
+++ b/src/tuiguest.c
@@ -478,7 +478,7 @@ int
478478 int i_attr;
479479 int i_maxlines;
480480 int i_outlines;
481- int i_endline;
481+ //int i_endline;
482482 char *pstr_temp;
483483 TuiGuest_LineAttr t_attr;
484484 chtype ch_line;
@@ -510,7 +510,7 @@ int
510510 { mvwprintw( lt_guest.p_subwin, gwl_info.i_width - 2, ((COLS - 2) / 2), "v" ); }
511511 }
512512
513- i_endline = lt_guest.i_start_line + i_outlines;
513+ //i_endline = lt_guest.i_start_line + i_outlines;
514514
515515 snprintf( str_fmt, sizeof( str_fmt ), "%%-%ds", (COLS - 2) );
516516 snprintf( str_valfmt, sizeof( str_valfmt ), "%%-%ds", (COLS - 2) - 25 );
--- a/src/tuihelp.c
+++ b/src/tuihelp.c
@@ -108,6 +108,11 @@ int
108108
109109 i_attr = 0x00;
110110 i_err = TextBuf_AppendLine( &lt_help.t_textbuf, str_temp, 0, &i_attr );
111+ if( 0x00 != i_err ) {
112+ ErrInfo_Error( "Can't appent help line.",
113+ HVISOR_ID_NONE, GUEST_ID_NONE, REQUEST_ID_NONE,
114+ errno, i_err, 0x00, str_temp );
115+ }
111116 }
112117
113118 return 0x00;
--- a/src/tuihvisor.c
+++ b/src/tuihvisor.c
@@ -319,7 +319,7 @@ int
319319 int i_attr;
320320 int i_maxlines;
321321 int i_outlines;
322- int i_endline;
322+ //int i_endline;
323323 char *pstr_temp;
324324 TuiHVisor_LineAttr t_attr;
325325 char str_fmt[32];
@@ -350,7 +350,7 @@ int
350350 { mvwprintw( lt_hvisor.p_subwin, gwl_info.i_width - 2, ((COLS - 2) / 2), "v" ); }
351351 }
352352
353- i_endline = lt_hvisor.i_start_line + i_outlines;
353+ //i_endline = lt_hvisor.i_start_line + i_outlines;
354354
355355 snprintf( str_fmt, sizeof( str_fmt ), "%%-%ds", (COLS - 2) );
356356 snprintf( str_valfmt, sizeof( str_valfmt ), "%%-%ds", (COLS - 2) - 25 );
--- a/src/vmbhyve.c
+++ b/src/vmbhyve.c
@@ -159,10 +159,13 @@ int
159159
160160 // Exec. Cmd ---
161161 i_err = p_hvcon->ExecCmd( p_hvcon, p_req->str_cmdline );
162+ if( 0x00 != i_err ) {
163+ return -0x03;
164+ }
162165
163166 // Analyze Cmd Result ---
164167 if( 0x00 != p_hvcon->i_exit ) {
165- return -0x03;
168+ return -0x04;
166169 }
167170
168171 return 0x00;
@@ -181,7 +184,6 @@ int
181184 int i_item;
182185 int i_gnow;
183186 int i_gtype;
184- int i_vnc;
185187 int i_newflag = 0x00;
186188 int i_gnext;
187189 char *pstr_line;
@@ -200,14 +202,17 @@ int
200202
201203 // Genereate CmdLine ---
202204 i_len = snprintf( p_req->str_cmdline, REQUEST_MAXLEN_CMDLINE,
203- "%s vm list --all", p_hvcon->sudo.str_cmdline );
205+ "%s vm list", p_hvcon->sudo.str_cmdline );
204206
205207 // Exec. Cmd ---
206208 i_err = p_hvcon->ExecCmd( p_hvcon, p_req->str_cmdline );
209+ if( 0x00 != i_err ) {
210+ return -0x01;
211+ }
207212
208213 // Analyze Cmd Result ---
209214 if( 0x00 != p_hvcon->i_exit ) {
210- return -0x01;
215+ return -0x02;
211216 }
212217
213218 pstr_next = p_hvcon->str_buffer;
@@ -266,7 +271,6 @@ int
266271 strncpy( str_temp, pstr_item[5], sizeof( str_temp ) );
267272 if( '-' != str_temp[0] ) {
268273 pstr_host = NULL;
269- i_vnc = 0;
270274 pstr_now = str_temp;
271275 pstr_host = strsep( &pstr_now, ":" );
272276
--- a/src/vmtui_main.c
+++ b/src/vmtui_main.c
@@ -115,6 +115,9 @@ int main( int argc, char *argv[] ) {
115115
116116 SettingFile_SetSettingFilePath( NULL, NULL );
117117 i_err = SettingFile_ReadSetting();
118+ if( 0x00 != i_err ) {
119+ goto goto_main_post;
120+ }
118121
119122 // Initial Auto-Connect HVisor ---
120123 i_hvisor = HVisor_GetTopID();
@@ -168,7 +171,7 @@ int main( int argc, char *argv[] ) {
168171 i_hvisor = i_hnext;
169172 }
170173
171-//goto_main_post:
174+goto_main_post:
172175 VmTui_Term();
173176
174177 return 0x00;