]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #9398 from yuwata/lgtm-fixes
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Jun 2018 11:12:44 +0000 (13:12 +0200)
committerGitHub <noreply@github.com>
Mon, 25 Jun 2018 11:12:44 +0000 (13:12 +0200)
fixes error handlings and several cleanups suggested by LGTM

doc/CODE_QUALITY.md
hwdb/60-evdev.hwdb
hwdb/60-keyboard.hwdb
man/journald.conf.xml
src/boot/efi/boot.c
src/core/manager.c
src/network/networkd-dhcp4.c
src/timesync/timesyncd-manager.c
src/timesync/timesyncd-manager.h
tmpfiles.d/systemd.conf.m4

index d020b19c079a6749bbe238ac07be7d1db15c36ea..e673ad58ad9671d5196f15427af23e3a630548f2 100644 (file)
@@ -56,5 +56,9 @@ available functionality:
 13. When building systemd from a git checkout the build scripts will
     automatically enable a git commit hook that ensures whitespace cleanliness.
 
-Access to Coverity and oss-fuzz reports is limited. Please reach out the the
-maintainers is you need access.
+14. [LGTM](https://lgtm.com/) analyzes every commit pushed to master. The list
+    of active alerts can be found at
+    https://lgtm.com/projects/g/systemd/systemd/alerts/?mode=list.
+
+Access to Coverity and oss-fuzz reports is limited. Please reach out to the
+maintainers if you need access.
index ab4b3068e64ddca4f0da7ccad12b7acd3bdda703..eaf68c2040862f1a9de9c00367a71b90f633e0cb 100644 (file)
@@ -475,6 +475,15 @@ evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnTOSHIBA:pnSATELLITER830*
  EVDEV_ABS_35=1238:5785:53
  EVDEV_ABS_36=1045:4826:76
 
+#########################################
+# UGTablet
+#########################################
+
+# Trust Flex Graphics Tablet
+evdev:input:b0003v2179p0004*
+ EVDEV_ABS_00=::234
+ EVDEV_ABS_01=::328
+
 #########################################
 # Waltop
 #########################################
index ae3ec3ca159f2244d70530f85dfe528621aa7d5e..37b92b1090868193c7ce593589f6c7e6d8ebd941 100644 (file)
@@ -944,6 +944,10 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*PR200*:pvr*
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnU90/U100:*
  KEYBOARD_KEY_e4=reserved
 
+# MSI GS65 Stealth Thin has a physical backslash key next to the space bar
+evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pnGS65StealthThin*:pvr*
+ KEYBOARD_KEY_56=backslash
+
 ###########################################################
 # MSI
 ###########################################################
index ee8e8b7faf89aa80b208cfafae513bc7e9d1c0eb..927cd6da829405db34232e78cfd4e8b4ac9799cc 100644 (file)
         subsequently something else causes the file system to fill up,
         journald will stop using more space, but it will not be
         removing existing files to reduce the footprint again,
-        either.</para>
+        either. Also note that only archived files are deleted to reduce the
+        space occupied by journal files. This means that, in effect, there might
+        still be more space used than <varname>SystemMaxUse=</varname> or
+        <varname>RuntimeMaxUse=</varname> limit after a vacuuming operation is
+        complete.</para>
 
         <para><varname>SystemMaxFileSize=</varname> and
         <varname>RuntimeMaxFileSize=</varname> control how large
index fc0a64b23ab180d07b2d6d90f6672be63093df4e..48c9db7c154e173a5d800b251ce333b511f51a76 100644 (file)
@@ -1590,7 +1590,6 @@ static VOID config_entry_add_linux(Config *config, EFI_LOADED_IMAGE *loaded_imag
                 if (os_name && os_id && (os_version || os_build)) {
                         CHAR16 *conf;
                         CHAR16 *path;
-                        CHAR16 *cmdline;
 
                         conf = PoolPrint(L"%s-%s", os_id, os_version ? : os_build);
                         path = PoolPrint(L"\\EFI\\Linux\\%s", f->FileName);
@@ -1599,13 +1598,16 @@ static VOID config_entry_add_linux(Config *config, EFI_LOADED_IMAGE *loaded_imag
                         FreePool(content);
                         content = NULL;
                         /* read the embedded cmdline file */
-                        err = file_read(linux_dir, f->FileName, offs[1], szs[1] - 1, &content, NULL);
+                        err = file_read(linux_dir, f->FileName, offs[1], szs[1], &content, NULL);
                         if (!EFI_ERROR(err)) {
-                                cmdline = stra_to_str(content);
-                                entry->options = cmdline;
-                                cmdline = NULL;
+
+                                /* chomp the newline */
+                                if (content[szs[1]-1] == '\n')
+                                        content[szs[1]-1] = '\0';
+
+                                entry->options = stra_to_str(content);
                         }
-                        FreePool(cmdline);
+
                         FreePool(conf);
                         FreePool(path);
                 }
index 930df4e23afc409530ac5993bec636e6f2dc6338..a3ae481158e756f57e4e4f30aa3e169ecd345ead 100644 (file)
@@ -1234,6 +1234,8 @@ static void manager_clear_jobs_and_units(Manager *m) {
 
         m->n_on_console = 0;
         m->n_running_jobs = 0;
+        m->n_installed_jobs = 0;
+        m->n_failed_jobs = 0;
 }
 
 Manager* manager_free(Manager *m) {
index 34c1f63568e45686ae139d8fd045454f14c8d9d3..9fd46ed764b20890add7a49029370eaf94135e9e 100644 (file)
@@ -122,7 +122,7 @@ static int link_set_dhcp_routes(Link *link) {
 
         r = sd_dhcp_lease_get_router(link->dhcp_lease, &gateway);
         if (r == -ENODATA)
-                log_link_info_errno(link, r, "DHCP: No routes received from DHCP server: %m");
+                log_link_info_errno(link, r, "DHCP: No gateway received from DHCP server: %m");
         else if (r < 0)
                 log_link_warning_errno(link, r, "DHCP error: could not get gateway: %m");
 
index 2b731af9e3f1bc3ba6ce6765fd64b7dbc6c2343b..ca14253adf31c899d67f72df9132bef8123148cf 100644 (file)
@@ -604,7 +604,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
         m->dest_time = *recv_time;
         m->spike = spike;
 
-        log_debug("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+"PRI_TIMEX"ppm%s",
+        log_debug("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+"PRIi64"ppm%s",
                   m->poll_interval_usec / USEC_PER_SEC, offset, delay, m->samples_jitter, m->drift_freq / 65536,
                   spike ? " (ignored)" : "");
 
@@ -793,7 +793,7 @@ int manager_connect(Manager *m) {
 
         m->event_retry = sd_event_source_unref(m->event_retry);
         if (!ratelimit_below(&m->ratelimit)) {
-                log_debug("Slowing down attempts to contact servers.");
+                log_debug("Delaying attempts to contact servers.");
 
                 r = sd_event_add_time(m->event, &m->event_retry, clock_boottime_or_monotonic(), now(clock_boottime_or_monotonic()) + RETRY_USEC, 0, manager_retry_connect, m);
                 if (r < 0)
index d8d97cc1ee9383321155e460ef34f5556d090a9c..18347416d14fd8b1f07238925afd71f8e8253c6c 100644 (file)
@@ -79,7 +79,7 @@ struct Manager {
         /* last change */
         bool jumped;
         bool sync;
-        long drift_freq;
+        int64_t drift_freq;
 
         /* watch for time changes */
         sd_event_source *event_clock_watch;
index 0992f74209dbc011271a11b0ba6ce0ed98803303..120e42a1b94648001e3bf73088b3e35c5432332d 100644 (file)
@@ -17,9 +17,9 @@ d /run/systemd/users 0755 root root -
 d /run/systemd/machines 0755 root root -
 d /run/systemd/shutdown 0755 root root -
 m4_ifdef(`ENABLE_NETWORKD',
-d /run/systemd/netif - - - -
-d /run/systemd/netif/links - - - -
-d /run/systemd/netif/leases - - - -
+d /run/systemd/netif 0755 - - -
+d /run/systemd/netif/links 0755 - - -
+d /run/systemd/netif/leases 0755 - - -
 )m4_dnl
 
 d /run/log 0755 root root -