@pmatilai commented on this pull request.


> +        /* send a signal that transaction is over */
+        (void) write_fifo(&fapolicyd_state, "1\n");
+        /* flush cache */
+        (void) write_fifo(&fapolicyd_state, "2\n");
+    }
+
+ end:
+    return RPMRC_OK;
+}
+
+static rpmRC fapolicyd_scriptlet_pre(rpmPlugin plugin, const char *s_name,
+                                     int type)
+{
+    if (fapolicyd_state.fd > 0 &&
+        fapolicyd_state.changed_files > 0 &&
+        fapolicyd_state.installed_package ) {

The if condition is on same indentation level as the following code, making it 
hard to see where the condition stops and code starts. There are various ways 
to deal with that, my favourite generally is moving (parts of) the condition 
into a helper variable, with well-named variables this has the effect of making 
the code self-documenting as well. For example:
```
    int need_flush = (fapolicyd_state.changed_files > 0) && 
fapolicyd_state.installed_package;
    if (fapolicyd_state.fd > 0 && need_flush) {
        ...
    }
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1475#pullrequestreview-577351791
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to