File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Crashlytics/Crashlytics/Handlers Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ void FIRCLSSignalSafeRemoveHandlers(bool includingAbort) {
161
161
}
162
162
163
163
bool FIRCLSSignalSafeInstallPreexistingHandlers (FIRCLSSignalReadContext * roContext ) {
164
- bool success ;
164
+ __block bool success = true ;
165
165
166
166
FIRCLSSignalSafeRemoveHandlers (true);
167
167
@@ -179,17 +179,16 @@ bool FIRCLSSignalSafeInstallPreexistingHandlers(FIRCLSSignalReadContext *roConte
179
179
#endif
180
180
181
181
// re-install the original handlers, if any
182
- success = true;
183
- for (int i = 0 ; i < FIRCLSSignalCount ; ++ i ) {
184
- if (roContext -> originalActions [i ].sa_sigaction == NULL ) {
185
- continue ;
182
+ FIRCLSSignalEnumerateHandledSignals (^(int idx , int currentSignal ) {
183
+ if (roContext -> originalActions [idx ].sa_sigaction == NULL ) {
184
+ return ;
186
185
}
187
186
188
- if (sigaction (FIRCLSFatalSignals [ i ] , & roContext -> originalActions [i ], 0 ) != 0 ) {
189
- FIRCLSSDKLog ("Unable to install handler for %d (%s)\n" , i , strerror (errno ));
187
+ if (sigaction (currentSignal , & roContext -> originalActions [idx ], 0 ) != 0 ) {
188
+ FIRCLSSDKLog ("Unable to install handler for %d (%s)\n" , currentSignal , strerror (errno ));
190
189
success = false;
191
190
}
192
- }
191
+ });
193
192
194
193
return success ;
195
194
}
You can’t perform that action at this time.
0 commit comments