Skip to content

fix: replace variable 's' with 'source' in deleteSdEventSource#528

Merged
sangelovic merged 1 commit intoKistler-Group:masterfrom
DespinaRizk:fix/deleteSdEventSource
Mar 4, 2026
Merged

fix: replace variable 's' with 'source' in deleteSdEventSource#528
sangelovic merged 1 commit intoKistler-Group:masterfrom
DespinaRizk:fix/deleteSdEventSource

Conversation

@DespinaRizk
Copy link
Copy Markdown
Contributor

@DespinaRizk DespinaRizk commented Mar 4, 2026

This PR fixes a variable name typo in Connection::deleteSdEventSource in src/Connection.cpp.

In the #else branch (used when LIBSYSTEMD_VERSION < 243), the code used the variable s instead of the function parameter source:

sd_event_source_set_enabled(s, SD_EVENT_OFF);
sd_event_source_unref(s);

This can lead to a compilation error if s is undefined, or unintended behavior.

The fix replaces s with source to ensure the correct event source is unreferenced.

- sd_event_source_set_enabled(s, SD_EVENT_OFF);
- sd_event_source_unref(s);
+ sd_event_source_set_enabled(source, SD_EVENT_OFF);
+ sd_event_source_unref(source);

@DespinaRizk DespinaRizk changed the title fix: replace incorrect variable 's' with 'source' in deleteSdEventSource fix: replace variable 's' with 'source' in deleteSdEventSource Mar 4, 2026
@sangelovic sangelovic merged commit 7363944 into Kistler-Group:master Mar 4, 2026
10 checks passed
@sangelovic
Copy link
Copy Markdown
Collaborator

Thanks @DespinaRizk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants