]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-remote: coding style fixlets
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Jan 2025 23:59:05 +0000 (08:59 +0900)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 Jan 2025 09:09:08 +0000 (10:09 +0100)
Co-authored-by: Andrii Chubatiuk <andrew.chubatiuk@gmail.com>
src/journal-remote/journal-gatewayd.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-remote.h
src/journal-remote/journal-upload.c
src/journal-remote/journal-upload.h

index 73b22170e7920d1357ac4327f80acdac44672538..646253e1a5e464cf648d926b8e784ce76a58ce7b 100644 (file)
@@ -816,7 +816,7 @@ static int request_handler_machine(
         _cleanup_(MHD_destroy_responsep) struct MHD_Response *response = NULL;
         RequestMeta *m = ASSERT_PTR(connection_cls);
         int r;
-        _cleanup_free_ charhostname = NULL, *pretty_name = NULL, *os_name = NULL;
+        _cleanup_free_ char *hostname = NULL, *pretty_name = NULL, *os_name = NULL;
         uint64_t cutoff_from = 0, cutoff_to = 0, usage = 0;
         sd_id128_t mid, bid;
         _cleanup_free_ char *v = NULL, *json = NULL;
index 7156bc7727e7c525add5d20b1e281eba1167f7e3..c48b7df2014e45134d7049c3d3d27bf7df0a515c 100644 (file)
 #define CERT_FILE     CERTIFICATE_ROOT "/certs/journal-remote.pem"
 #define TRUST_FILE    CERTIFICATE_ROOT "/ca/trusted.pem"
 
-static const chararg_url = NULL;
-static const chararg_getter = NULL;
-static const chararg_listen_raw = NULL;
-static const chararg_listen_http = NULL;
-static const chararg_listen_https = NULL;
-static char** arg_files = NULL; /* Do not free this. */
+static const char *arg_url = NULL;
+static const char *arg_getter = NULL;
+static const char *arg_listen_raw = NULL;
+static const char *arg_listen_http = NULL;
+static const char *arg_listen_https = NULL;
+static char **arg_files = NULL; /* Do not free this. */
 static bool arg_compress = true;
 static bool arg_seal = false;
 static int http_socket = -1, https_socket = -1;
-static char** arg_gnutls_log = NULL;
+static char **arg_gnutls_log = NULL;
 
 static JournalWriteSplitMode arg_split_mode = _JOURNAL_WRITE_SPLIT_INVALID;
 static char *arg_output = NULL;
@@ -78,7 +78,7 @@ static DEFINE_CONFIG_PARSE_ENUM(config_parse_write_split_mode, journal_write_spl
  **********************************************************************
  **********************************************************************/
 
-static int spawn_child(const char* child, char** argv) {
+static int spawn_child(const char *child, char **argv) {
         pid_t child_pid;
         int fd[2], r;
 
@@ -110,7 +110,7 @@ static int spawn_child(const char* child, char** argv) {
         return fd[0];
 }
 
-static int spawn_curl(const charurl) {
+static int spawn_curl(const char *url) {
         char **argv = STRV_MAKE("curl",
                                 "-HAccept: application/vnd.fdo.journal",
                                 "--silent",
@@ -544,9 +544,9 @@ static int setup_raw_socket(RemoteServer *s, const char *address) {
 
 static int create_remoteserver(
                 RemoteServer *s,
-                const charkey,
-                const charcert,
-                const chartrust) {
+                const char *key,
+                const char *cert,
+                const char *trust) {
 
         int r, n, fd;
 
@@ -937,7 +937,7 @@ static int parse_argv(int argc, char *argv[]) {
 
                 case ARG_GNUTLS_LOG:
 #if HAVE_GNUTLS
-                        for (const charp = optarg;;) {
+                        for (const char *p = optarg;;) {
                                 _cleanup_free_ char *word = NULL;
 
                                 r = extract_first_word(&p, &word, ",", 0);
index 92187b7420c59f1ca1ff0415fc15062510e1f986..c92651b409bd62ec3a8966759406452e52a2bfc7 100644 (file)
@@ -44,7 +44,7 @@ MHDDaemonWrapper *MHDDaemonWrapper_free(MHDDaemonWrapper *d) {
 }
 #endif
 
-static int open_output(RemoteServer *s, Writer *w, const charhost) {
+static int open_output(RemoteServer *s, Writer *w, const char *host) {
         _cleanup_free_ char *_filename = NULL;
         const char *filename;
         int r;
@@ -233,7 +233,7 @@ static int remove_source(RemoteServer *s, int fd) {
         return 0;
 }
 
-int journal_remote_add_source(RemoteServer *s, int fd, charname, bool own_name) {
+int journal_remote_add_source(RemoteServer *s, int fd, char *name, bool own_name) {
         RemoteSource *source = NULL;
         int r;
 
@@ -492,7 +492,7 @@ static int dispatch_blocking_source_event(sd_event_source *event,
 }
 
 static int accept_connection(
-                const chartype,
+                const char *type,
                 int fd,
                 SocketAddress *addr,
                 char **hostname) {
index f1ec5d9a543d0d45e39576b9aa2f771980fc7f21..5c1d4863b903b52a359e4256c276d28e57313452 100644 (file)
@@ -59,7 +59,7 @@ int journal_remote_server_init(
 
 int journal_remote_get_writer(RemoteServer *s, const char *host, Writer **writer);
 
-int journal_remote_add_source(RemoteServer *s, int fd, charname, bool own_name);
+int journal_remote_add_source(RemoteServer *s, int fd, char *name, bool own_name);
 int journal_remote_add_raw_socket(RemoteServer *s, int fd);
 int journal_remote_handle_raw_source(
                 sd_event_source *event,
index eb36d03130c3543dd6fc17508049d125a79894b6..c702b00806ec192aede95083b3fbaf0fd1af9680 100644 (file)
@@ -42,7 +42,7 @@
 #define TRUST_FILE    CERTIFICATE_ROOT "/ca/trusted.pem"
 #define DEFAULT_PORT  19532
 
-static const chararg_url = NULL;
+static const char *arg_url = NULL;
 static const char *arg_key = NULL;
 static const char *arg_cert = NULL;
 static const char *arg_trust = NULL;
index 5ba3c4f1a0e7ed08f28a9e461c0e12e0e5cb87db..fe6abb75a9e5427be7e016841675cf4dda64fdb2 100644 (file)
@@ -40,7 +40,7 @@ typedef struct Uploader {
         int input;
 
         /* journal stuff */
-        sd_journaljournal;
+        sd_journal *journal;
 
         entry_state entry_state;
         const void *field_data;