]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal-remote/microhttpd-util.c
coccinelle: make use of SYNTHETIC_ERRNO
[thirdparty/systemd.git] / src / journal-remote / microhttpd-util.c
index 9cb7dfc9203b8780e5e829409c5f9f5baf2aa12c..adf40b5abde96035b5aa67abfb4e4dad7cbcc79f 100644 (file)
@@ -1,10 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2012 Lennart Poettering
-  Copyright 2012 Zbigniew JÄ™drzejewski-Szmek
-***/
 
 #include <stddef.h>
 #include <stdio.h>
@@ -159,8 +153,7 @@ static int log_enable_gnutls_category(const char *cat) {
                                 log_reset_gnutls_level();
                                 return 0;
                         }
-        log_error("No such log category: %s", cat);
-        return -EINVAL;
+        return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No such log category: %s", cat);
 }
 
 int setup_gnutls_logger(char **categories) {
@@ -212,10 +205,9 @@ static int get_client_cert(gnutls_session_t session, gnutls_x509_crt_t *client_c
         assert(client_cert);
 
         pcert = gnutls_certificate_get_peers(session, &listsize);
-        if (!pcert || !listsize) {
-                log_error("Failed to retrieve certificate chain");
-                return -EINVAL;
-        }
+        if (!pcert || !listsize)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "Failed to retrieve certificate chain");
 
         r = gnutls_x509_crt_init(&cert);
         if (r < 0) {