Remove build warnings
authorpr.jung <pr.jung@samsung.com>
Mon, 17 Sep 2018 06:39:43 +0000 (15:39 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 12 Feb 2024 15:37:43 +0000 (16:37 +0100)
- Add TIZEN_JOURNALD_KMSG
- Print kmsg log on dlogutil because journald is heavier than dlogutil

Change-Id: I763cfccbb0d877c52d8448de4a50966a33c84981
Signed-off-by: pr.jung <pr.jung@samsung.com>
configure.ac
src/core/service.c
src/journal/journald-kmsg.c
src/libsystemd/sd-bus/bus-dump.c

index 7260e31..9961afd 100644 (file)
@@ -1373,6 +1373,20 @@ AS_IF([test "x$enable_manpages" != xno], [
 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
 
 # ------------------------------------------------------------------------------
+journald_kmsg=no
+AC_ARG_ENABLE(journald-kmsg, AS_HELP_STRING([--disable-journald-kmsg], [Disable journald kmsg]),
+                [case "${enableval}" in
+                        yes) journald-kmsg=yes ;;
+                        no) journald-kmsg=no ;;
+                        *) AC_MSG_ERROR(bad value ${enableval} for --disable-journald-kmsg) ;;
+                esac],
+                [journald_kmsg=no])
+
+if test "x${journald_kmsg}" != xno; then
+       AC_DEFINE(TIZEN_JOURNALD_KMSG, 1, [Define if journald kmsg is on])
+fi
+
+# ------------------------------------------------------------------------------
 AC_ARG_ENABLE(hibernate,
        [AC_HELP_STRING([--disable-hibernate], [disable hibernation support])],
        enable_hibernate=$enableval, enable_hibernate=yes)
index bf10cc1..889d6fd 100644 (file)
@@ -1178,10 +1178,10 @@ static int service_spawn(
 
         /* TODO workaround code */
         if (UNIT(s)->cgroup_realized) {
-                _cleanup_free_ char *path = NULL;
-                path = unit_default_cgroup_path(UNIT(s));
+                _cleanup_free_ char *path_temp = NULL;
+                path_temp = unit_default_cgroup_path(UNIT(s));
 
-                if (cg_check_cgroup_exist(path) < 0) {
+                if (cg_check_cgroup_exist(path_temp) < 0) {
                         log_unit_error(UNIT(s)->id, "CGROUP ERROR! (%s) is already realized but not exists", UNIT(s)->id);
                         UNIT(s)->cgroup_realized = false;
                         UNIT(s)->cgroup_realized_mask = 0;
index e62c32b..a2b6a15 100644 (file)
@@ -379,6 +379,7 @@ int server_flush_dev_kmsg(Server *s) {
         return 0;
 }
 
+#ifdef TIZEN_JOURNALD_KMSG
 static int dispatch_dev_kmsg(sd_event_source *es, int fd, uint32_t revents, void *userdata) {
         Server *s = userdata;
 
@@ -394,9 +395,9 @@ static int dispatch_dev_kmsg(sd_event_source *es, int fd, uint32_t revents, void
 
         return server_read_dev_kmsg(s);
 }
+#endif
 
 int server_open_dev_kmsg(Server *s) {
-        int r;
 
         assert(s);
 
@@ -408,9 +409,8 @@ int server_open_dev_kmsg(Server *s) {
         }
 
 // Requested by Profiling Part & PM Part - DISABLE KMSG online handling from journald
-// Plz, ask them about "why?"
-#if 0
-        r = sd_event_add_io(s->event, &s->dev_kmsg_event_source, s->dev_kmsg_fd, EPOLLIN, dispatch_dev_kmsg, s);
+#ifdef TIZEN_JOURNALD_KMSG
+        int r = sd_event_add_io(s->event, &s->dev_kmsg_event_source, s->dev_kmsg_fd, EPOLLIN, dispatch_dev_kmsg, s);
         if (r < 0) {
 
                 /* This will fail with EPERM on older kernels where
@@ -435,11 +435,13 @@ int server_open_dev_kmsg(Server *s) {
 
         return 0;
 
+#ifdef TIZEN_JOURNALD_KMSG
 fail:
         s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source);
         s->dev_kmsg_fd = safe_close(s->dev_kmsg_fd);
 
         return r;
+#endif
 }
 
 int server_open_kernel_seqnum(Server *s) {
index 301915d..5936601 100644 (file)
@@ -112,9 +112,9 @@ int bus_message_dot_dump(sd_bus_message *m, FILE *f) {
 void dot_dump_unique_name(sd_bus *bus, char *name, Hashmap *hashmap_wkn, FILE *f, sd_bus_message *m) {
         int r;
         bool update = false;
-        int obtained;
-        char *uname;
-        char *contents = NULL;
+        char *obtained;
+        const char *uname;
+        const char *contents = NULL;
         char type;
         union {
                 uint8_t u8;
@@ -146,8 +146,6 @@ void dot_dump_unique_name(sd_bus *bus, char *name, Hashmap *hashmap_wkn, FILE *f
                 }
         }
 
-        int x, y;
-
         if (!f)
                 f = stdout;