Re: [systemd-devel] SSL for gatewayd

2013-01-10 Thread Oleksii Shevchuk
> But for the normal
> use case, where you just want to browse messages from one computer
> and another computer under your control

In this situation CA shouldn't be used. SSH-like scheme (without third-party) is
ok for this usecase. Or maybe SASL authentication + TLS/brokenPKI combo
should be used.. 

> this is overkill

This is the service, which accepts incoming connections, and gives
access to sensitive data, anyway.

// IMO, surely
// wbr, Alex
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] bootchart: tabs to spaces?

2013-01-10 Thread Kay Sievers
On Thu, Jan 10, 2013 at 6:49 AM, Alessandro Delgado
 wrote:
> I like tabs better.
>
> Though the question should answer itself looking at the involving
> environment codebase. Consistency is what matters.

Tabs would make sense if we would use them strictly for indentation
and never for any kind of alignment. Then people could switch to any
number of tab width, and all would still look fine. That actually
would be a nice feature in theory.

But that's really not what people, or the "kernel-style" do with tabs,
they mix everything, it works only with 8 spaces tabs, or stuff gets
garbled when displayed. Hence tabs are a broken idea, have zero
benefit, they just needlessly complicate things and look ugly. We
don't want them anymore. :)

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] SSL for gatewayd

2013-01-10 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Jan 10, 2013 at 09:59:59AM +0200, Oleksii Shevchuk wrote:
> > But for the normal
> > use case, where you just want to browse messages from one computer
> > and another computer under your control
> 
> In this situation CA shouldn't be used. SSH-like scheme (without third-party) 
> is
> ok for this usecase. Or maybe SASL authentication + TLS/brokenPKI combo
> should be used.. 
Right now I generate a CA certificate, then a client and server certificates,
and than use the first one two sign the second and the third. Then I launch
the server with the server certificate, and tell it to trust CA, and e.g.
install the client certificate in firefox. Then browse messages.
Or specify client certificate as an option to each wget or curl invocation.

Can you say how things would work in your scheme? 

Zbyszek

> > this is overkill
> 
> This is the service, which accepts incoming connections, and gives
> access to sensitive data, anyway.
> 
> // IMO, surely
> // wbr, Alex
> 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] bootchart: make sure that every read buffer is null terminated

2013-01-10 Thread Lukáš Nykrýn
Hello,
I am not sure about this one. There is a probability that bufgetline
during first call in src/bootchart/log.c:265 can get string which is not
null-terminated.

Lukas
>From bb19a933eee9bad3f67d3069bfea6c4f476a840a Mon Sep 17 00:00:00 2001
From: Lukas Nykryn 
Date: Thu, 10 Jan 2013 14:36:42 +0100
Subject: [PATCH] bootchart: make sure that every read buffer is null
 terminated

---
 src/bootchart/log.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/bootchart/log.c b/src/bootchart/log.c
index eda001a..78f0cab 100644
--- a/src/bootchart/log.c
+++ b/src/bootchart/log.c
@@ -182,8 +182,10 @@ schedstat_next:
 
 if (e_fd) {
 n = pread(e_fd, buf, sizeof(buf) - 1, 0);
-if (n > 0)
+if (n > 0) {
+buf[n] = '\0';
 entropy_avail[sample] = atoi(buf);
+}
 }
 }
 
@@ -256,6 +258,7 @@ schedstat_next:
 close(ps->sched);
 continue;
 }
+buf[s] = '\0';
 
 if (!sscanf(buf, "%s %*s %*s", key))
 continue;
@@ -337,8 +340,8 @@ schedstat_next:
 if (ps->schedstat == -1)
 continue;
 }
-
-if (pread(ps->schedstat, buf, sizeof(buf) - 1, 0) <= 0) {
+s = pread(ps->schedstat, buf, sizeof(buf) - 1, 0);
+if (s <= 0) {
 /* clean up our file descriptors - assume that the process exited */
 close(ps->schedstat);
 if (ps->sched)
@@ -347,6 +350,8 @@ schedstat_next:
 //fclose(ps->smaps);
 continue;
 }
+buf[s] = '\0';
+
 if (!sscanf(buf, "%s %s %*s", rt, wt))
 continue;
 
@@ -401,7 +406,8 @@ catch_rename:
 if (ps->sched == -1)
 continue;
 }
-if (pread(ps->sched, buf, sizeof(buf) - 1, 0) <= 0) {
+s = pread(ps->sched, buf, sizeof(buf) - 1, 0);
+if (s <= 0) {
 /* clean up file descriptors */
 close(ps->sched);
 if (ps->schedstat)
@@ -410,6 +416,7 @@ catch_rename:
 //fclose(ps->smaps);
 continue;
 }
+buf[s] = '\0';
 
 if (!sscanf(buf, "%s %*s %*s", key))
 continue;
-- 
1.7.11.7

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] bootchart: make sure that every read buffer is null terminated

2013-01-10 Thread Kay Sievers
On Thu, Jan 10, 2013 at 3:16 PM, Lukáš Nykrýn  wrote:
> Hello,
> I am not sure about this one. There is a probability that bufgetline
> during first call in src/bootchart/log.c:265 can get string which is not
> null-terminated.

Applied.

Thanks,
Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] TODO

2013-01-10 Thread Andrey Borzenkov
В Thu, 10 Jan 2013 03:30:53 +0100
Zbigniew Jędrzejewski-Szmek  пишет:

> On Wed, Jan 09, 2013 at 06:10:58PM -0800, Lennart Poettering wrote:
> > +* add a man page "systemdall" that lists all of systemd's man pages, 
> > inspired by zsh's "zshall" page
> 
> Shouldn't just make-man-index.py be tweaked to generate .xml instead
> (like make-directive-index.py) ?
> 

zshall(1) does not actually "lists all of zsh's man pages". This is
what zsh(1) does. zshall(1) actually includes all of zsh man pages,
making it one bug large man page similar to bash.

List of all zsh's man pages appears on top of zshall(1) simply because
it includes zsh(1) as well :)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] bootchart: tabs to spaces?

2013-01-10 Thread Kok, Auke-jan H
On Thu, Jan 10, 2013 at 3:35 AM, Kay Sievers  wrote:
> On Thu, Jan 10, 2013 at 6:49 AM, Alessandro Delgado
>  wrote:
>> I like tabs better.
>>
>> Though the question should answer itself looking at the involving
>> environment codebase. Consistency is what matters.
>
> Tabs would make sense if we would use them strictly for indentation
> and never for any kind of alignment. Then people could switch to any
> number of tab width, and all would still look fine. That actually
> would be a nice feature in theory.
>
> But that's really not what people, or the "kernel-style" do with tabs,
> they mix everything, it works only with 8 spaces tabs, or stuff gets
> garbled when displayed. Hence tabs are a broken idea, have zero
> benefit, they just needlessly complicate things and look ugly. We
> don't want them anymore. :)

I'll do a patch myself to convert it - I'll submit it later today.

Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] bootchart: make sure that every read buffer is null terminated

2013-01-10 Thread Kok, Auke-jan H
On Thu, Jan 10, 2013 at 6:24 AM, Kay Sievers  wrote:
> On Thu, Jan 10, 2013 at 3:16 PM, Lukáš Nykrýn  wrote:
>> Hello,
>> I am not sure about this one. There is a probability that bufgetline
>> during first call in src/bootchart/log.c:265 can get string which is not
>> null-terminated.
>
> Applied.

thanks - there are probably a few others like these remaining in the
logger code - so I appreciate people looking at them.

Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] TODO

2013-01-10 Thread Lennart Poettering
On Thu, 10.01.13 21:06, Andrey Borzenkov (arvidj...@gmail.com) wrote:

> В Thu, 10 Jan 2013 03:30:53 +0100
> Zbigniew Jędrzejewski-Szmek  пишет:
> 
> > On Wed, Jan 09, 2013 at 06:10:58PM -0800, Lennart Poettering wrote:
> > > +* add a man page "systemdall" that lists all of systemd's man pages, 
> > > inspired by zsh's "zshall" page
> > 
> > Shouldn't just make-man-index.py be tweaked to generate .xml instead
> > (like make-directive-index.py) ?
> > 
> 
> zshall(1) does not actually "lists all of zsh's man pages". This is
> what zsh(1) does. zshall(1) actually includes all of zsh man pages,
> making it one bug large man page similar to bash.
> 
> List of all zsh's man pages appears on top of zshall(1) simply because
> it includes zsh(1) as well :)

Uh, ah. I prefer having systemdall however as an index only. Not really
convinced such a merged page makes much sense for us.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] TODO

2013-01-10 Thread Lennart Poettering
On Thu, 10.01.13 03:30, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:

> 
> On Wed, Jan 09, 2013 at 06:10:58PM -0800, Lennart Poettering wrote:
> > +* add a man page "systemdall" that lists all of systemd's man pages, 
> > inspired by zsh's "zshall" page
> 
> Shouldn't just make-man-index.py be tweaked to generate .xml instead
> (like make-directive-index.py) ?

Interesting idea, I like it. But maybe for the man page we want slightly
more info included than the HTML index has, for example the NAME section
of the man pages?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] bootchart: tabs to spaces?

2013-01-10 Thread Thomas H.P. Andersen
On Thu, Jan 10, 2013 at 7:24 PM, Kok, Auke-jan H
 wrote:
> On Thu, Jan 10, 2013 at 3:35 AM, Kay Sievers  wrote:
>> On Thu, Jan 10, 2013 at 6:49 AM, Alessandro Delgado
>>  wrote:
>>> I like tabs better.
>>>
>>> Though the question should answer itself looking at the involving
>>> environment codebase. Consistency is what matters.
>>
>> Tabs would make sense if we would use them strictly for indentation
>> and never for any kind of alignment. Then people could switch to any
>> number of tab width, and all would still look fine. That actually
>> would be a nice feature in theory.
>>
>> But that's really not what people, or the "kernel-style" do with tabs,
>> they mix everything, it works only with 8 spaces tabs, or stuff gets
>> garbled when displayed. Hence tabs are a broken idea, have zero
>> benefit, they just needlessly complicate things and look ugly. We
>> don't want them anymore. :)
>
> I'll do a patch myself to convert it - I'll submit it later today.

I already committed the patch to switch to spaces yesterday. I
understood your "well then, better do it quickly" as an okay for the
patch.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 3/3] bootchart: Convert malloc/memset to calloc.

2013-01-10 Thread Auke Kok
---
 src/bootchart/bootchart.c |  5 ++---
 src/bootchart/log.c   | 10 --
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 7bcfd98..37d8fbe 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -232,12 +232,11 @@ int main(int argc, char *argv[])
 }
 
 /* start with empty ps LL */
-ps_first = malloc(sizeof(struct ps_struct));
+ps_first = calloc(1, sizeof(struct ps_struct));
 if (!ps_first) {
-perror("malloc(ps_struct)");
+perror("calloc(ps_struct)");
 exit(EXIT_FAILURE);
 }
-memset(ps_first, 0, sizeof(struct ps_struct));
 
 /* handle TERM/INT nicely */
 memset(&sig, 0, sizeof(struct sigaction));
diff --git a/src/bootchart/log.c b/src/bootchart/log.c
index ff70e2d..48002fa 100644
--- a/src/bootchart/log.c
+++ b/src/bootchart/log.c
@@ -225,21 +225,19 @@ schedstat_next:
 char t[32];
 struct ps_struct *parent;
 
-ps->next_ps = malloc(sizeof(struct ps_struct));
+ps->next_ps = calloc(1, sizeof(struct ps_struct));
 if (!ps->next_ps) {
-perror("malloc(ps_struct)");
+perror("calloc(ps_struct)");
 exit (EXIT_FAILURE);
 }
-memset(ps->next_ps, 0, sizeof(struct ps_struct));
 ps = ps->next_ps;
 ps->pid = pid;
 
-ps->sample = malloc(sizeof(struct ps_sched_struct) * 
(len + 1));
+ps->sample = calloc(len + 1, sizeof(struct 
ps_sched_struct));
 if (!ps->sample) {
-perror("malloc(ps_struct)");
+perror("calloc(ps_struct)");
 exit (EXIT_FAILURE);
 }
-memset(ps->sample, 0, sizeof(struct ps_sched_struct) * 
(len + 1));
 
 pscount++;
 
-- 
1.7.11.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/3] bootchart: fix a -Wshadow warning for "now".

2013-01-10 Thread Auke Kok
---
 src/bootchart/log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bootchart/log.c b/src/bootchart/log.c
index c697121..ff70e2d 100644
--- a/src/bootchart/log.c
+++ b/src/bootchart/log.c
@@ -39,11 +39,11 @@ DIR *proc;
 
 double gettime_ns(void)
 {
-struct timespec now;
+struct timespec n;
 
-clock_gettime(CLOCK_MONOTONIC, &now);
+clock_gettime(CLOCK_MONOTONIC, &n);
 
-return (now.tv_sec + (now.tv_nsec / 10.0));
+return (n.tv_sec + (n.tv_nsec / 10.0));
 }
 
 
-- 
1.7.11.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/3] bootchart: Convert !strcmp usage to streq.

2013-01-10 Thread Auke Kok
---
 src/bootchart/bootchart.c | 21 +++--
 src/bootchart/log.c   |  5 +++--
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 3d77bab..7bcfd98 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -28,6 +28,7 @@
 
 
 #include "bootchart.h"
+#include "util.h"
 
 double graph_start;
 double log_start;
@@ -109,25 +110,25 @@ int main(int argc, char *argv[])
 
 // todo: filter leading/trailing whitespace
 
-if (!strcmp(key, "samples"))
+if (streq(key, "samples"))
 len = atoi(val);
-if (!strcmp(key, "freq"))
+if (streq(key, "freq"))
 hz = atof(val);
-if (!strcmp(key, "rel"))
+if (streq(key, "rel"))
 relative = atoi(val);
-if (!strcmp(key, "filter"))
+if (streq(key, "filter"))
 filter = atoi(val);
-if (!strcmp(key, "pss"))
+if (streq(key, "pss"))
 pss = atoi(val);
-if (!strcmp(key, "output"))
+if (streq(key, "output"))
 strncpy(output_path, val, PATH_MAX - 1);
-if (!strcmp(key, "init"))
+if (streq(key, "init"))
 strncpy(init_path, val, PATH_MAX - 1);
-if (!strcmp(key, "scale_x"))
+if (streq(key, "scale_x"))
 scale_x = atof(val);
-if (!strcmp(key, "scale_y"))
+if (streq(key, "scale_y"))
 scale_y = atof(val);
-if (!strcmp(key, "entropy"))
+if (streq(key, "entropy"))
 entropy = atoi(val);
 }
 fclose(f);
diff --git a/src/bootchart/log.c b/src/bootchart/log.c
index 78f0cab..c697121 100644
--- a/src/bootchart/log.c
+++ b/src/bootchart/log.c
@@ -26,6 +26,7 @@
 
 
 #include "bootchart.h"
+#include "util.h"
 
 /*
  * Alloc a static 4k buffer for stdio - primarily used to increase
@@ -125,9 +126,9 @@ void log_sample(int sample)
 while (m) {
 if (sscanf(m, "%s %s", key, val) < 2)
 goto vmstat_next;
-if (!strcmp(key, "pgpgin"))
+if (streq(key, "pgpgin"))
 blockstat[sample].bi = atoi(val);
-if (!strcmp(key, "pgpgout")) {
+if (streq(key, "pgpgout")) {
 blockstat[sample].bo = atoi(val);
 break;
 }
-- 
1.7.11.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] bootchart: tabs to spaces?

2013-01-10 Thread Kok, Auke-jan H
On Thu, Jan 10, 2013 at 11:41 AM, Thomas H.P. Andersen  wrote:
> On Thu, Jan 10, 2013 at 7:24 PM, Kok, Auke-jan H
>  wrote:
>> On Thu, Jan 10, 2013 at 3:35 AM, Kay Sievers  wrote:
>>> On Thu, Jan 10, 2013 at 6:49 AM, Alessandro Delgado
>>>  wrote:
 I like tabs better.

 Though the question should answer itself looking at the involving
 environment codebase. Consistency is what matters.
>>>
>>> Tabs would make sense if we would use them strictly for indentation
>>> and never for any kind of alignment. Then people could switch to any
>>> number of tab width, and all would still look fine. That actually
>>> would be a nice feature in theory.
>>>
>>> But that's really not what people, or the "kernel-style" do with tabs,
>>> they mix everything, it works only with 8 spaces tabs, or stuff gets
>>> garbled when displayed. Hence tabs are a broken idea, have zero
>>> benefit, they just needlessly complicate things and look ugly. We
>>> don't want them anymore. :)
>>
>> I'll do a patch myself to convert it - I'll submit it later today.
>
> I already committed the patch to switch to spaces yesterday. I
> understood your "well then, better do it quickly" as an okay for the
> patch.

No worries, it's not much more than a `sed` anyway.

Auke
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] TODO

2013-01-10 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Jan 10, 2013 at 08:30:53PM +0100, Lennart Poettering wrote:
> On Thu, 10.01.13 03:30, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:
> 
> > 
> > On Wed, Jan 09, 2013 at 06:10:58PM -0800, Lennart Poettering wrote:
> > > +* add a man page "systemdall" that lists all of systemd's man pages, 
> > > inspired by zsh's "zshall" page
> > 
> > Shouldn't just make-man-index.py be tweaked to generate .xml instead
> > (like make-directive-index.py) ?
> 
> Interesting idea, I like it. But maybe for the man page we want slightly
> more info included than the HTML index has, for example the NAME section
> of the man pages?
Hm, isn't NAME section already included in index.html?

Btw, systemd(1) is already taken, so systemd.all (or systemdall) it'll
have to be.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 1/3] bootchart: Convert !strcmp usage to streq.

2013-01-10 Thread Zbigniew Jędrzejewski-Szmek
Applied all three.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] TODO

2013-01-10 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Jan 10, 2013 at 09:30:02PM +0100, Tom Gundersen wrote:
> On Jan 10, 2013 9:17 PM, "Zbigniew Jędrzejewski-Szmek" 
> wrote:
> >
> > On Thu, Jan 10, 2013 at 08:30:53PM +0100, Lennart Poettering wrote:
> > > On Thu, 10.01.13 03:30, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl)
> wrote:
> > >
> > > >
> > > > On Wed, Jan 09, 2013 at 06:10:58PM -0800, Lennart Poettering wrote:
> > > > > +* add a man page "systemdall" that lists all of systemd's man
> pages, inspired by zsh's "zshall" page
> > > >
> > > > Shouldn't just make-man-index.py be tweaked to generate .xml instead
> > > > (like make-directive-index.py) ?
> > >
> > > Interesting idea, I like it. But maybe for the man page we want slightly
> > > more info included than the HTML index has, for example the NAME section
> > > of the man pages?
> > Hm, isn't NAME section already included in index.html?
> >
> > Btw, systemd(1) is already taken, so systemd.all (or systemdall) it'll
> > have to be.
> 
> How about making it part of systemd(1)?
The list is now >200 items long. But I guess that if it landed
in 'SEE ALSO' in systemd(1), that could work.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] SSL for gatewayd

2013-01-10 Thread David Strauss
On Thu, Jan 10, 2013 at 10:54 PM, Zbigniew Jędrzejewski-Szmek
 wrote:
> Can you say how things would work in your scheme?

The scheme we use at Pantheon is that plus mapping the CN to "user"
and OU to "group." Then, we typically manage a grant list based on
groups but with a logging trail that records the CN.

--
David Strauss
   | da...@davidstrauss.net
   | +1 512 577 5827 [mobile]
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 3/3] bootchart: Convert malloc/memset to calloc.

2013-01-10 Thread David Strauss
+1, especially for the reduced chance of changes happening to the
malloc but not the memset causing mysterious bug.

On Fri, Jan 11, 2013 at 5:35 AM, Auke Kok  wrote:
> ---
>  src/bootchart/bootchart.c |  5 ++---
>  src/bootchart/log.c   | 10 --
>  2 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
> index 7bcfd98..37d8fbe 100644
> --- a/src/bootchart/bootchart.c
> +++ b/src/bootchart/bootchart.c
> @@ -232,12 +232,11 @@ int main(int argc, char *argv[])
>  }
>
>  /* start with empty ps LL */
> -ps_first = malloc(sizeof(struct ps_struct));
> +ps_first = calloc(1, sizeof(struct ps_struct));
>  if (!ps_first) {
> -perror("malloc(ps_struct)");
> +perror("calloc(ps_struct)");
>  exit(EXIT_FAILURE);
>  }
> -memset(ps_first, 0, sizeof(struct ps_struct));
>
>  /* handle TERM/INT nicely */
>  memset(&sig, 0, sizeof(struct sigaction));
> diff --git a/src/bootchart/log.c b/src/bootchart/log.c
> index ff70e2d..48002fa 100644
> --- a/src/bootchart/log.c
> +++ b/src/bootchart/log.c
> @@ -225,21 +225,19 @@ schedstat_next:
>  char t[32];
>  struct ps_struct *parent;
>
> -ps->next_ps = malloc(sizeof(struct ps_struct));
> +ps->next_ps = calloc(1, sizeof(struct ps_struct));
>  if (!ps->next_ps) {
> -perror("malloc(ps_struct)");
> +perror("calloc(ps_struct)");
>  exit (EXIT_FAILURE);
>  }
> -memset(ps->next_ps, 0, sizeof(struct ps_struct));
>  ps = ps->next_ps;
>  ps->pid = pid;
>
> -ps->sample = malloc(sizeof(struct ps_sched_struct) * 
> (len + 1));
> +ps->sample = calloc(len + 1, sizeof(struct 
> ps_sched_struct));
>  if (!ps->sample) {
> -perror("malloc(ps_struct)");
> +perror("calloc(ps_struct)");
>  exit (EXIT_FAILURE);
>  }
> -memset(ps->sample, 0, sizeof(struct ps_sched_struct) 
> * (len + 1));
>
>  pscount++;
>
> --
> 1.7.11.2
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 
David Strauss
   | da...@davidstrauss.net
   | +1 512 577 5827 [mobile]
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] TODO

2013-01-10 Thread Tollef Fog Heen
]] Lennart Poettering 

> Uh, ah. I prefer having systemdall however as an index only. Not really
> convinced such a merged page makes much sense for us.

That doesn't sound like systemdall, it sounds like systemd(7).  The
useful thing about zshall (and by extension systemdall) is it's more
greppable than a zillion smaller pages.

-- 
Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel