diff --git a/coccinelle/empty-to-null.cocci b/coccinelle/empty-to-null.cocci index 1cc89475a6f..82819e9e3c9 100644 --- a/coccinelle/empty-to-null.cocci +++ b/coccinelle/empty-to-null.cocci @@ -1,7 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ @@ -/* Avoid running this transformation on the empty_to_null function itself */ -position p : script:python() { p[0].current_element != "empty_to_null" }; +/* Avoid running this transformation on the empty_to_null macro itself. + * See the note in strempty.cocci to understand the weird magic below. +*/ +position p : script:python() { + not (p[0].file == "src/basic/string-util.h" and p[0].current_element == "something_else") +}; expression s; @@ diff --git a/src/sysupdate/sysupdate-resource.c b/src/sysupdate/sysupdate-resource.c index 04d425299d2..e1e260addcc 100644 --- a/src/sysupdate/sysupdate-resource.c +++ b/src/sysupdate/sysupdate-resource.c @@ -553,7 +553,7 @@ int resource_resolve_path( r = stat("/run/systemd/volatile-root", &orig_root_stats); if (r < 0) { - if (errno == -ENOENT) /* volatile-root not found */ + if (errno == ENOENT) /* volatile-root not found */ r = get_block_device_harder("/usr/", &d); else return log_error_errno(r, "Failed to stat /run/systemd/volatile-root: %m");