};
}
-PidRef *pidref_free(PidRef *pidref) {
+PidRef* pidref_free(PidRef *pidref) {
/* Regularly, this is an embedded structure. But sometimes we want it on the heap too */
if (!pidref)
return NULL;
_cleanup_close_ int dup_fd = -EBADF;
pid_t dup_pid = 0;
- assert(dest);
+ /* If NULL is passed we'll generate a PidRef that refers to no process. This makes it easy to
+ * copy pidref fields that might or might not reference a process yet. */
- /* Allocates a new PidRef on the heap, making it a copy of the specified pidref. This does not try to
- * acquire a pidfd if we don't have one yet!
- *
- * If NULL is passed we'll generate a PidRef that refers to no process. This makes it easy to copy
- * pidref fields that might or might not reference a process yet. */
+ assert(dest);
if (pidref) {
if (pidref->fd >= 0) {
_cleanup_(pidref_freep) PidRef *dup_pidref = NULL;
int r;
+ /* Allocates a new PidRef on the heap, making it a copy of the specified pidref. This does not try to
+ * acquire a pidfd if we don't have one yet! */
+
assert(ret);
dup_pidref = newdup(PidRef, &PIDREF_NULL, 1);
bool pidref_is_self(const PidRef *pidref);
void pidref_done(PidRef *pidref);
-PidRef *pidref_free(PidRef *pidref);
+PidRef* pidref_free(PidRef *pidref);
DEFINE_TRIVIAL_CLEANUP_FUNC(PidRef*, pidref_free);
int pidref_copy(const PidRef *pidref, PidRef *dest);