From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from imap.gmail.com [173.194.76.109] by localhost with POP3 (fetchmail-6.3.26) for (single-drop); Wed, 22 May 2024 22:59:38 +0200 (CEST) Received: by 2002:a05:6a11:2489:b0:55f:c3c0:ed08 with SMTP id sg9csp910661pxb; Wed, 22 May 2024 13:59:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVV5QL6bFjdnAnQjyrGh7mFZ5dgogq3oV/0KAYXyeSj0ffx4MX015JhfyYN2IiGmJ9eQ0GHUtduPoSepSzQMfCjRbM7/E4S5U8= X-Google-Smtp-Source: AGHT+IFlcABJDNGrjEjBx4aJ8xbuV1n0qyA3tn686MOROO+Uk7HRhrqP8oavd1CYwuPEV7VW7z/6 X-Received: by 2002:a05:6808:85:b0:3c9:966e:32ed with SMTP id 5614622812f47-3cdb1cda139mr3665458b6e.5.1716411568472; Wed, 22 May 2024 13:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716411568; cv=none; d=google.com; s=arc-20160816; b=wbDIBylHY7JaR0EwVUoy+XAXwii/LZ6uczxNEesmkmg18EiiafsvJ5j2EUh8WZwoEP wT6/P8S6HSwoXlbeOSek0RnHBFZkxXFj76ZIlsjhIxx5N+HQ9EQ47kz+K8WJb5cVbB0B FD1R6bzWjGj3zTFq/SNPk0yEW9EQsTEnFx4XYK6JRxqrosl4g2g5+Dlc3nFIiJizm4sC hCHZWRur8B2NNpO/IzMGoI17fPiHf0LeROttO7GJSI03h4ZrWFaYdTqlHWXXmF5vl89O Aar6UavRuYQEZ8MJwFac3G5aIPFMQUDssP6efOGrMW7vgbvKBxvyrUUQs/Y+WC/yjF74 YPhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:list-unsubscribe:list-subscribe:list-post :list-owner:list-help:list-archive:list-archive:archived-at :archived-at:list-id:precedence:cc:message-id-hash:mime-version :references:in-reply-to:message-id:date:subject:to:from:delivered-to; bh=5djfccQwpsrBQ6xldKYy759j+sRACBkmF3wNW49zgbg=; fh=Sda5+ix8pPMDNzAK4mfqRvxwOV3J+P0OHYKuDzXzUCA=; b=bUuHbPaCOd6jltUVvKgpQRx58QwdGhhBdCx+AWKJ8T2x3slPyY8byDqxJtYhnGBous rCZ27hkoCZxudF0oQU02uYZC8Qxl/BKmlq7taJrT9JAyZo1DoaIkw+dRPf0+/e/4uVuT 3CnEo7KW42A7e3wAPDvatsfVL+HfgzVnPNb9P/19u19NbkNc1j4fo8cU3XmjdS9XNjis +Lnd9wfZH1jIgXskjATFG0eDcOTxBkwH3TJqR+i44JUVzUW36oKlL31Xy+XCqSrOb89B ya8CfvfQepYlX1MiRPJXrHhbRZ3YgDjyMqz0u8aDzq/EwNz0twVFnXdYPdbWPAuY9HVR PAuA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of passt-dev-bounces@passt.top designates 88.198.0.164 as permitted sender) smtp.mailfrom=passt-dev-bounces@passt.top Return-Path: Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com. [205.139.110.120]) by mx.google.com with ESMTPS id af79cd13be357-792cf65c158si147830685a.765.2024.05.22.13.59.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 13:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of passt-dev-bounces@passt.top designates 88.198.0.164 as permitted sender) client-ip=88.198.0.164; Authentication-Results: mx.google.com; spf=pass (google.com: domain of passt-dev-bounces@passt.top designates 88.198.0.164 as permitted sender) smtp.mailfrom=passt-dev-bounces@passt.top Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-AStkuLnVN3KoAibNW-g88A-1; Wed, 22 May 2024 16:59:26 -0400 X-MC-Unique: AStkuLnVN3KoAibNW-g88A-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2842E1955DC1 for ; Wed, 22 May 2024 20:59:26 +0000 (UTC) Received: by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) id 199D01954223; Wed, 22 May 2024 20:59:26 +0000 (UTC) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.46]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 172161955BE4 for ; Wed, 22 May 2024 20:59:26 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [170.10.128.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B8E77195608E for ; Wed, 22 May 2024 20:59:25 +0000 (UTC) Received: from passt.top (passt.top [88.198.0.164]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-dMt743L7OlOtn5TfpcaogQ-1; Wed, 22 May 2024 16:59:20 -0400 X-MC-Unique: dMt743L7OlOtn5TfpcaogQ-1 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by passt.top (Postfix) with ESMTP id 07D0B5A031B; Wed, 22 May 2024 22:59:15 +0200 (CEST) Received: by passt.top (Postfix, from userid 1000) id C53435A030D; Wed, 22 May 2024 22:59:11 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 8/8] conf, passt.h: Rename pid_file in struct ctx to pidfile Date: Wed, 22 May 2024 22:59:11 +0200 Message-ID: <20240522205911.261325-9-sbrivio@redhat.com> In-Reply-To: <20240522205911.261325-1-sbrivio@redhat.com> References: <20240522205911.261325-1-sbrivio@redhat.com> MIME-Version: 1.0 Message-ID-Hash: 6M5FZF3D2ZOWDFIIKBPVGHWEN73QESXS X-Message-ID-Hash: 6M5FZF3D2ZOWDFIIKBPVGHWEN73QESXS X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson , "'Richard W . M . Jones'" , Minxi Hou X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition;Similar Internal Domain=false;Similar Monitored External Domain=false;Custom External Domain=false;Mimecast External Domain=false;Newly Observed Domain=false;Internal User Name=false;Custom Display Name List=false;Reply-to Address Mismatch=false;Targeted Threat Dictionary=false;Mimecast Threat Dictionary=false;Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII"; x-default=true We have pidfile_fd now, pid_file_fd would be quite ugly. Signed-off-by: Stefano Brivio --- conf.c | 8 ++++---- passt.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf.c b/conf.c index f62a5eb..50383a3 100644 --- a/conf.c +++ b/conf.c @@ -1123,7 +1123,7 @@ static void conf_open_files(struct ctx *c) =09if (c->mode =3D=3D MODE_PASST && c->fd_tap =3D=3D -1) =09=09c->fd_tap_listen =3D tap_sock_unix_open(c->sock_path); =20 -=09c->pidfile_fd =3D pidfile_open(c->pid_file); +=09c->pidfile_fd =3D pidfile_open(c->pidfile); } =20 /** @@ -1456,12 +1456,12 @@ void conf(struct ctx *c, int argc, char **argv) =20 =09=09=09break; =09=09case 'P': -=09=09=09if (*c->pid_file) +=09=09=09if (*c->pidfile) =09=09=09=09die("Multiple --pid options given"); =20 -=09=09=09ret =3D snprintf(c->pid_file, sizeof(c->pid_file), "%s", +=09=09=09ret =3D snprintf(c->pidfile, sizeof(c->pidfile), "%s", =09=09=09=09 optarg); -=09=09=09if (ret <=3D 0 || ret >=3D (int)sizeof(c->pid_file)) +=09=09=09if (ret <=3D 0 || ret >=3D (int)sizeof(c->pidfile)) =09=09=09=09die("Invalid PID file: %s", optarg); =20 =09=09=09break; diff --git a/passt.h b/passt.h index 3e50612..46d073a 100644 --- a/passt.h +++ b/passt.h @@ -184,7 +184,7 @@ struct ip6_ctx { * @nofile:=09=09Maximum number of open files (ulimit -n) * @sock_path:=09=09Path for UNIX domain socket * @pcap:=09=09Path for packet capture file - * @pid_file:=09=09Path to PID file, empty string if not configured + * @pidfile:=09=09Path to PID file, empty string if not configured * @pidfile_fd:=09=09File descriptor for PID file, -1 if none * @pasta_netns_fd:=09File descriptor for network namespace in pasta mode * @no_netns_quit:=09In pasta mode, don't exit if fs-bound namespace is go= ne @@ -236,7 +236,7 @@ struct ctx { =09char sock_path[UNIX_PATH_MAX]; =09char pcap[PATH_MAX]; =20 -=09char pid_file[PATH_MAX]; +=09char pidfile[PATH_MAX]; =09int pidfile_fd; =20 =09int one_off; --=20 2.43.0