From: Stefan Berger Date: Tue, 5 Oct 2021 16:39:49 +0000 (-0400) Subject: swtpm_setup: Use pidfile filename rather than fd (Cygwni, BSDs) X-Git-Tag: v0.7.0-rc1~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ca3379116b7772bad545468425f3805c21d17099;p=swtpm.git swtpm_setup: Use pidfile filename rather than fd (Cygwni, BSDs) Use the pidfile filename rather than the fd because Cygwin for example does not seem to support passed file descriptors and also OpenBSD does not pass some test cases because of this. Signed-off-by: Stefan Berger --- diff --git a/src/swtpm_setup/swtpm.c b/src/swtpm_setup/swtpm.c index b5de43b..3a48127 100644 --- a/src/swtpm_setup/swtpm.c +++ b/src/swtpm_setup/swtpm.c @@ -76,7 +76,8 @@ static int swtpm_start(struct swtpm *self) logerr(self->logfile, "Could not create pidfile: %s\n", strerror(errno)); goto error; } - pidfile_arg = g_strdup_printf("fd=%d", pidfile_fd); + // pass filename rather than fd (Cygwin) + pidfile_arg = g_strdup_printf("file=%s", pidfile); argv = concat_arrays(self->swtpm_exec_l, (gchar*[]){