[systemd-commits] 5 commits - Makefile.am man/custom-html.xsl src/bootchart src/python-systemd TODO

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Thu Mar 7 12:41:55 PST 2013


 Makefile.am                  |    6 +++---
 TODO                         |    2 ++
 man/custom-html.xsl          |   24 ++++++++++++++++++++++++
 src/bootchart/bootchart.c    |    8 +++++---
 src/bootchart/svg.c          |    5 ++++-
 src/python-systemd/_reader.c |    5 +++--
 6 files changed, 41 insertions(+), 9 deletions(-)

New commits:
commit 1f3523baf7418adf3b2738b3917ef956a8414ab7
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Mar 7 15:28:03 2013 -0500

    Revert "bootchart: use _cleanup_close_"
    
    This reverts commit 0ea9530d401827e299c6e04a433e69a7a2a89d80.
    
    attribute(cleanup) can only be used inside functions (*of, sysfd
    are leaked).
    
    Cleanup functions are only called once when exiting scope (*f
    is leaked twice).

diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 0ad14dc..65f16c5 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -66,10 +66,10 @@ struct cpu_stat_struct cpustat[MAXCPUS];
 int pscount;
 int cpus;
 double interval;
-FILE _cleanup_fclose_ *of = NULL;
+FILE *of = NULL;
 int overrun = 0;
 static int exiting = 0;
-int _cleanup_close_ sysfd=-1;
+int sysfd=-1;
 
 /* graph defaults */
 bool entropy = false;
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
         char datestr[200];
         time_t t = 0;
         const char *fn;
-        _cleanup_fclose_ FILE *f = NULL;
+        _cleanup_fclose_ FILE *f;
         int gind;
         int i, r;
         char *init = NULL, *output = NULL;
@@ -378,8 +378,10 @@ int main(int argc, char *argv[])
         svg_do(build);
 
         fprintf(stderr, "systemd-bootchart wrote %s\n", output_file);
+        fclose(of);
 
         closedir(proc);
+        close(sysfd);
 
         /* nitpic cleanups */
         ps = ps_first;
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index 7947671..9fee810 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -150,7 +150,7 @@ static void svg_title(const char *build)
         char date[256] = "Unknown";
         char cpu[256] = "Unknown";
         char *c;
-        FILE _cleanup_fclose_ *f = NULL;
+        FILE *f;
         time_t t;
         int fd;
         struct utsname uts;
@@ -161,6 +161,7 @@ static void svg_title(const char *build)
         if (f) {
                 if (!fgets(cmdline, 255, f))
                         sprintf(cmdline, "Unknown");
+                fclose(f);
         }
 
         /* extract root fs so we can find disk model name in sysfs */
@@ -175,6 +176,7 @@ static void svg_title(const char *build)
                 if (f) {
                         if (!fgets(model, 255, f))
                                 fprintf(stderr, "Error reading disk model for %s\n", rootbdev);
+                        fclose(f);
                 }
         }
 
@@ -196,6 +198,7 @@ static void svg_title(const char *build)
                                 break;
                         }
                 }
+                fclose(f);
         }
 
         svg("<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n",

commit db7f1dde30068bd980c78db77867b6956f5295e2
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Mar 7 15:32:33 2013 -0500

    systemd-python: fix segfault on double close

diff --git a/TODO b/TODO
index 1cc69b9..4419582 100644
--- a/TODO
+++ b/TODO
@@ -570,6 +570,8 @@ Features:
    - allow reading of only select fields in systemd.journal._reader.Reader
    - export sd_journal_test_cursor in systemd.journal._reader.Reader
    - export sd_journal_get_usage in systemd.journal._reader.Reader
+   - add systemd.journal._reader._Reader.closed attribute (it can
+     be just "return self->j != NULL")
    - figure out a simple way to wait for journal events in a way that
      works with ^C
 
diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c
index 52e6b1c..160ab69 100644
--- a/src/python-systemd/_reader.c
+++ b/src/python-systemd/_reader.c
@@ -171,6 +171,7 @@ PyDoc_STRVAR(Reader_close__doc__,
 static PyObject* Reader_close(Reader *self, PyObject *args)
 {
     sd_journal_close(self->j);
+    self->j = NULL;
     Py_RETURN_NONE;
 }
 

commit 516424a411925d8141e1f72422f85ffb1639d5ea
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Mar 7 15:27:30 2013 -0500

    systemd-python: fix typos

diff --git a/src/python-systemd/_reader.c b/src/python-systemd/_reader.c
index 42029ab..52e6b1c 100644
--- a/src/python-systemd/_reader.c
+++ b/src/python-systemd/_reader.c
@@ -164,7 +164,7 @@ static PyObject* Reader_reliable_fd(Reader *self, PyObject *args)
 }
 
 PyDoc_STRVAR(Reader_close__doc__,
-             "reliable_fd() -> None\n\n"
+             "close() -> None\n\n"
              "Free resources allocated by this Reader object.\n"
              "This method invokes sd_journal_close().\n"
              "See man:sd_journal_close(3).");
@@ -428,7 +428,7 @@ static PyObject* Reader_seek_head(Reader *self, PyObject *args)
 
 PyDoc_STRVAR(Reader_seek_tail__doc__,
              "seek_tail() -> None\n\n"
-             "Jump to the beginning of the journal.\n"
+             "Jump to the end of the journal.\n"
              "This method invokes sd_journal_seek_tail().\n"
              "See man:sd_journal_seek_tail(3).");
 static PyObject* Reader_seek_tail(Reader *self, PyObject *args)

commit 2cc8d9731aff3e401bc6a5a243f20fec123d48e6
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Mar 7 13:13:44 2013 -0500

    man/*.html: link to directives, python, guvev, libudev in headers
    
    Since the HTML files are in different directories during build
    and on fd.o, links are broken in the build directory. This could
    be fixed by moving stuff around, or by modifying the files during
    upload, but I think that people do not usually create HTML files
    for local browsing, and this is not necessary.

diff --git a/man/custom-html.xsl b/man/custom-html.xsl
index 906ddc5..c612baf 100644
--- a/man/custom-html.xsl
+++ b/man/custom-html.xsl
@@ -40,6 +40,30 @@
       <xsl:text>index.html</xsl:text>
     </xsl:attribute>
     <xsl:text>Index </xsl:text>
+  </a>·
+  <a>
+    <xsl:attribute name="href">
+      <xsl:text>systemd.directives.html</xsl:text>
+    </xsl:attribute>
+    <xsl:text>Directives </xsl:text>
+  </a>·
+  <a>
+    <xsl:attribute name="href">
+      <xsl:text>../python-systemd/index.html</xsl:text>
+    </xsl:attribute>
+    <xsl:text>Python </xsl:text>
+  </a>·
+  <a>
+    <xsl:attribute name="href">
+      <xsl:text>../libudev/index.html</xsl:text>
+    </xsl:attribute>
+    <xsl:text>libudev </xsl:text>
+  </a>·
+  <a>
+    <xsl:attribute name="href">
+      <xsl:text>../libudev/index.html</xsl:text>
+    </xsl:attribute>
+    <xsl:text>gudev </xsl:text>
   </a>
   <hr/>
 </xsl:template>

commit e91fb201c7114f971b645c1f862e0ba890093704
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Mar 7 14:42:27 2013 -0500

    build-sys: move sphinx output to docs/python-systemd
    
    And on fd.o it goes into a dir parallel to man/.

diff --git a/Makefile.am b/Makefile.am
index 3f64937..c1c8cdb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3513,8 +3513,8 @@ PAPER = $(shell cat /etc/papersize 2>/dev/null || echo a4)
 SPHINXOPTS = -D latex_paper_size=$(PAPER)
 sphinx-%:
 	$(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
-	$(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/man/python-systemd/
-	$(AM_V_at)echo Output has been generated in $(abs_top_builddir)/man/python-systemd/
+	$(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/docs/python-systemd/
+	$(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/python-systemd/
 
 destdir-sphinx: all
 	dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
@@ -3850,7 +3850,7 @@ doc-sync: all destdir-sphinx
 	gtkdoc-rebase --html-dir=docs/gudev/html --online
 	rsync -av --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
 	rsync -av --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
-	rsync -av --delete --omit-dir-times man/python-systemd/ $(www_target)/man/python-systemd/
+	rsync -av --delete --omit-dir-times docs/python-systemd/ $(www_target)/python-systemd/
 
 git-tag:
 	git tag "v$(VERSION)" -m "systemd $(VERSION)"



More information about the systemd-commits mailing list