aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2024-05-22 20:39:30 +0200
committerStefano Brivio <sbrivio@redhat.com>2024-05-23 16:44:14 +0200
commit0608ec42f2c134b2b72f4939a722ff3433dbaae0 (patch)
treeffbef71de66d62daf2b651e86621ab35ae96dd3c
parentc9b24134656925e53fea3cde0b33ab143dcd84af (diff)
downloadpasst-0608ec42f2c134b2b72f4939a722ff3433dbaae0.tar
passt-0608ec42f2c134b2b72f4939a722ff3433dbaae0.tar.gz
passt-0608ec42f2c134b2b72f4939a722ff3433dbaae0.tar.bz2
passt-0608ec42f2c134b2b72f4939a722ff3433dbaae0.tar.lz
passt-0608ec42f2c134b2b72f4939a722ff3433dbaae0.tar.xz
passt-0608ec42f2c134b2b72f4939a722ff3433dbaae0.tar.zst
passt-0608ec42f2c134b2b72f4939a722ff3433dbaae0.zip
conf, passt.h: Rename pid_file in struct ctx to pidfile
We have pidfile_fd now, pid_file_fd would be quite ugly. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
-rw-r--r--conf.c8
-rw-r--r--passt.h4
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)
if (c->mode == MODE_PASST && c->fd_tap == -1)
c->fd_tap_listen = tap_sock_unix_open(c->sock_path);
- c->pidfile_fd = pidfile_open(c->pid_file);
+ c->pidfile_fd = pidfile_open(c->pidfile);
}
/**
@@ -1456,12 +1456,12 @@ void conf(struct ctx *c, int argc, char **argv)
break;
case 'P':
- if (*c->pid_file)
+ if (*c->pidfile)
die("Multiple --pid options given");
- ret = snprintf(c->pid_file, sizeof(c->pid_file), "%s",
+ ret = snprintf(c->pidfile, sizeof(c->pidfile), "%s",
optarg);
- if (ret <= 0 || ret >= (int)sizeof(c->pid_file))
+ if (ret <= 0 || ret >= (int)sizeof(c->pidfile))
die("Invalid PID file: %s", optarg);
break;
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: Maximum number of open files (ulimit -n)
* @sock_path: Path for UNIX domain socket
* @pcap: Path for packet capture file
- * @pid_file: Path to PID file, empty string if not configured
+ * @pidfile: Path to PID file, empty string if not configured
* @pidfile_fd: File descriptor for PID file, -1 if none
* @pasta_netns_fd: File descriptor for network namespace in pasta mode
* @no_netns_quit: In pasta mode, don't exit if fs-bound namespace is gone
@@ -236,7 +236,7 @@ struct ctx {
char sock_path[UNIX_PATH_MAX];
char pcap[PATH_MAX];
- char pid_file[PATH_MAX];
+ char pidfile[PATH_MAX];
int pidfile_fd;
int one_off;