summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tls.c b/src/tls.c
index ca8a307..f7ed344 100644
--- a/src/tls.c
+++ b/src/tls.c
@@ -58,7 +58,7 @@ tls_host_gencert(struct gmnisrv_tls *tlsconf, struct gmnisrv_host *host,
assert(r);
int pfd = open(keypath, O_CREAT | O_WRONLY, 0600);
- if (!pfd) {
+ if (pfd < 0) {
server_error("opening private key for writing failed: %s",
strerror(errno));
return 1;