[systemd-commits] 3 commits - TODO src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Tue Jul 16 17:53:50 PDT 2013


 TODO              |    8 ++++++++
 src/shared/util.c |   12 ++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit dd94c17e7da89fa612952119ac825116dc5a8deb
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 17 02:52:41 2013 +0200

    util: make gcc shut up by passing a 0 mode param to open()
    
    If we pass a variable to open()'s flags parameter it really wants a mode
    parameter too, otherwise some gcc version whine. Hence, pass 0 in that
    case.

diff --git a/src/shared/util.c b/src/shared/util.c
index f56d2a2..5b602ea 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1875,8 +1875,10 @@ int open_terminal(const char *name, int mode) {
          * https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554172/comments/245
          */
 
+        assert(!(mode & O_CREAT));
+
         for (;;) {
-                fd = open(name, mode);
+                fd = open(name, mode, 0);
                 if (fd >= 0)
                         break;
 
@@ -3520,7 +3522,9 @@ DIR *xopendirat(int fd, const char *name, int flags) {
         int nfd;
         DIR *d;
 
-        nfd = openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|flags);
+        assert(!(flags & O_CREAT));
+
+        nfd = openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|flags, 0);
         if (nfd < 0)
                 return NULL;
 

commit 32b2634edf218e250b84615bbf106b2baf42d69b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 17 02:48:53 2013 +0200

    util: make some gcc versions shut up regarding unintialized variable access

diff --git a/src/shared/util.c b/src/shared/util.c
index 15abd50..f56d2a2 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -367,7 +367,7 @@ int safe_atolli(const char *s, long long int *ret_lli) {
 
 int safe_atod(const char *s, double *ret_d) {
         char *x = NULL;
-        double d;
+        double d = 0;
 
         assert(s);
         assert(ret_d);
@@ -5752,7 +5752,7 @@ int search_and_fopen_nulstr(const char *path, const char *mode, const char *sear
 
 int create_tmp_dir(char template[], char** dir_name) {
         int r = 0;
-        char *d, *dt;
+        char *d = NULL, *dt;
 
         assert(dir_name);
 

commit c5757cc8dbcddb3e8b13ebba4ea4b36589bfd3db
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 17 02:29:19 2013 +0200

    update TODO

diff --git a/TODO b/TODO
index 2e97356..902fbc6 100644
--- a/TODO
+++ b/TODO
@@ -68,6 +68,14 @@ Features:
 
 * when a kernel driver logs in a tight loop we should ratelimit that too.
 
+* man: document in the journalctl man page what the colors mean
+
+* "systemctl disable" of a unit instance removes all symlinks, should
+  only remove the instance symlink (systemct disable of a template
+  unit however should remove them all).
+
+* journald: optionally, log debug messages to /run but everything else to /var
+
 * journald: optionally, when messages with a high log prioerity are logged, sync() immeidately.
 
 * introduce %v resolving to the string returned by "uname -r"



More information about the systemd-commits mailing list