libcamera: process: Return error if already running

Returning 0 when a running process is already managed can be confusing
since the parameters might be completely different, causing the caller
to mistakenly assume that the program it specified has been started.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze 2025-03-25 18:02:59 +01:00
parent 0a591eaf8c
commit fae2b506d7

View file

@ -241,7 +241,7 @@ int Process::start(const std::string &path,
int ret; int ret;
if (running_) if (running_)
return 0; return -EBUSY;
int childPid = fork(); int childPid = fork();
if (childPid == -1) { if (childPid == -1) {