]> git.proxmox.com Git - swtpm.git/commitdiff
swtpm_setup: Use pidfile filename rather than fd (Cygwni, BSDs)
authorStefan Berger <stefanb@linux.ibm.com>
Tue, 5 Oct 2021 16:39:49 +0000 (12:39 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 5 Oct 2021 17:50:45 +0000 (13:50 -0400)
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 <stefanb@linux.ibm.com>
src/swtpm_setup/swtpm.c

index b5de43b1febab9297c6d04d2ec2b152dae951cb4..3a481273bba6b0c81bea818c6c7abde6f09d8704 100644 (file)
@@ -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*[]){