From patchwork Thu Apr 24 11:40:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23256 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 75E12C327D for ; Thu, 24 Apr 2025 11:41:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8CF7268AD5; Thu, 24 Apr 2025 13:41:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="qE82I3ol"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4EB7B68ACC for ; Thu, 24 Apr 2025 13:41:08 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3674F1666; Thu, 24 Apr 2025 13:41:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745494866; bh=Qz9cUuFaDliK3CR4EEBKiEQbQrPsPaP/+AEhQUc9DRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qE82I3olg4Er13shwbs8T1XAI7zaZeKcHq4ZveIj/ljZwpEukCRsaf3QUNeEJeCBa O422XIZ5xrWqk/tJQGw+ivpD6JYCHdvj6Hqqy6zai2RPlkgM2ihViy2KhZOk2K3CmQ Zq+U7F49cels9R9OsTRZYoo++GZ2sCw/5dyr20kA= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Laurent Pinchart Subject: [RFC PATCH v5 4/9] libcamera: process: Return error if already running Date: Thu, 24 Apr 2025 13:40:58 +0200 Message-ID: <20250424114103.451395-5-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250424114103.451395-1-barnabas.pocze@ideasonboard.com> References: <20250424114103.451395-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp index c22c9af5d..ca9733d77 100644 --- a/src/libcamera/process.cpp +++ b/src/libcamera/process.cpp @@ -241,7 +241,7 @@ int Process::start(const std::string &path, int ret; if (pid_ > 0) - return 0; + return -EBUSY; int childPid = fork(); if (childPid == -1) {