Skip to content

Commit

Permalink
fix error: 'for' loop initial declarations are only allowed in C99 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Nov 13, 2024
1 parent 4f8957d commit 82a93de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions neb_module_naemon/mod_gearman.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ static void register_neb_callbacks(void) {

/* deregister all events */
int nebmodule_deinit( int flags, int reason ) {
int x = 0;

nm_log( NSLOG_INFO_MESSAGE, "mod_gearman: deinitializing\n" );
gm_log( GM_LOG_TRACE, "nebmodule_deinit(%i, %i)\n", flags, reason );

Expand Down Expand Up @@ -262,7 +264,7 @@ int nebmodule_deinit( int flags, int reason ) {
}

/* register export callbacks */
for(int x = 0; x < GM_NEBTYPESSIZE; x++) {
for(x = 0; x < GM_NEBTYPESSIZE; x++) {
if(mod_gm_opt->exports[x]->elem_number > 0)
neb_deregister_callback( x, gearman_module_handle );
}
Expand All @@ -286,9 +288,11 @@ int nebmodule_deinit( int flags, int reason ) {
}

void shutdown_threads() {
int x = 0;

/* stop result threads */
gm_should_terminate = TRUE;
for(int x = 0; x < result_threads_running; x++) {
for(x = 0; x < result_threads_running; x++) {
if(result_thr[x] == NULL) {
continue;
}
Expand Down

0 comments on commit 82a93de

Please sign in to comment.