Changeset View
Changeset View
Standalone View
Standalone View
ksysguardd/Command.c
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
46 | static sigset_t SignalSet; | 46 | static sigset_t SignalSet; | ||
47 | 47 | | |||
48 | void command_cleanup( void* v ); | 48 | void command_cleanup( void* v ); | ||
49 | 49 | | |||
50 | void command_cleanup( void* v ) | 50 | void command_cleanup( void* v ) | ||
51 | { | 51 | { | ||
52 | if ( v ) { | 52 | if ( v ) { | ||
53 | Command* c = v; | 53 | Command* c = v; | ||
54 | if ( c->command ) | | |||
55 | free ( c->command ); | 54 | free ( c->command ); | ||
56 | if ( c->type ) | | |||
57 | free ( c->type ); | 55 | free ( c->type ); | ||
58 | free ( v ); | | |||
59 | } | 56 | } | ||
57 | free ( v ); | ||||
60 | } | 58 | } | ||
61 | 59 | | |||
62 | /* | 60 | /* | ||
63 | ================================ public part ================================= | 61 | ================================ public part ================================= | ||
64 | */ | 62 | */ | ||
65 | 63 | | |||
66 | int ReconfigureFlag = 0; | 64 | int ReconfigureFlag = 0; | ||
67 | int CheckSetupFlag = 0; | 65 | int CheckSetupFlag = 0; | ||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
147 | void removeCommand( const char* command ) | 145 | void removeCommand( const char* command ) | ||
148 | { | 146 | { | ||
149 | Command* cmd; | 147 | Command* cmd; | ||
150 | 148 | | |||
151 | for ( cmd = first_ctnr( CommandList ); cmd; cmd = next_ctnr( CommandList ) ) { | 149 | for ( cmd = first_ctnr( CommandList ); cmd; cmd = next_ctnr( CommandList ) ) { | ||
152 | if ( cmd->command && strcmp( cmd->command, command ) == 0 ) { | 150 | if ( cmd->command && strcmp( cmd->command, command ) == 0 ) { | ||
153 | remove_ctnr( CommandList ); | 151 | remove_ctnr( CommandList ); | ||
154 | free( cmd->command ); | 152 | free( cmd->command ); | ||
155 | if ( cmd->type ) | | |||
156 | free( cmd->type ); | 153 | free( cmd->type ); | ||
157 | free( cmd ); | 154 | free( cmd ); | ||
158 | } | 155 | } | ||
159 | } | 156 | } | ||
160 | 157 | | |||
161 | ReconfigureFlag = 1; | 158 | ReconfigureFlag = 1; | ||
162 | } | 159 | } | ||
163 | 160 | | |||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |