aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/processes.hh
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-04-05 20:35:13 +0200
committereldritch horrors <pennae@lix.systems>2024-06-23 11:52:49 +0000
commitb43a2e84c4b2fa7cb1167693652702e6dac95f53 (patch)
treec6fa909571c64bd5c5d8b8e70892bf64452ae791 /src/libutil/processes.hh
parenta9949f4760fea60ee790c27629e9620bf3ab5e3f (diff)
libutil: make Pid -> pid_t operations explicit
Change-Id: I3137cc140590001fe7ba542844e735944a0a9255
Diffstat (limited to 'src/libutil/processes.hh')
-rw-r--r--src/libutil/processes.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/processes.hh b/src/libutil/processes.hh
index b84fc7c4b..2079e1b36 100644
--- a/src/libutil/processes.hh
+++ b/src/libutil/processes.hh
@@ -29,13 +29,14 @@ public:
Pid(pid_t pid);
~Pid() noexcept(false);
void operator =(pid_t pid);
- operator pid_t();
+ explicit operator bool() const { return pid != -1; }
int kill();
int wait();
void setSeparatePG(bool separatePG);
void setKillSignal(int signal);
pid_t release();
+ pid_t get() const { return pid; }
};
/**