Skip to content

Commit fa057dc

Browse files
authored
Change variable logged when handler unable to be installed (#8114)
1 parent 3566987 commit fa057dc

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Crashlytics/Crashlytics/Handlers/FIRCLSSignal.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void FIRCLSSignalSafeRemoveHandlers(bool includingAbort) {
161161
}
162162

163163
bool FIRCLSSignalSafeInstallPreexistingHandlers(FIRCLSSignalReadContext *roContext) {
164-
bool success;
164+
__block bool success = true;
165165

166166
FIRCLSSignalSafeRemoveHandlers(true);
167167

@@ -179,17 +179,16 @@ bool FIRCLSSignalSafeInstallPreexistingHandlers(FIRCLSSignalReadContext *roConte
179179
#endif
180180

181181
// 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;
186185
}
187186

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));
190189
success = false;
191190
}
192-
}
191+
});
193192

194193
return success;
195194
}

0 commit comments

Comments
 (0)