Commit graph

19 commits

Author SHA1 Message Date
Harald Hoyer 7fd1b19bc9 move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-18 09:11:22 +02:00
Zbigniew Jędrzejewski-Szmek 1c6330456c Use initalization instead of explicit zeroing in more places 2013-04-10 18:59:42 -04:00
Cristian Rodríguez 9607d9470e Always use our own MAX/MIN definitions
code in src/shared/macro.h only defined MAX/MIN in case
they were not defined previously. however the MAX/MIN
macros implemented in glibc are not of the "safe" kind but defined
as:

define MIN(a,b) (((a)<(b))?(a):(b))
define MAX(a,b) (((a)>(b))?(a):(b))

Avoid nasty side effects by using our own versions instead.

Also fix the warnings derived from this change.

[zj: - modify MAX3 macro to fix warning about _a shadowing _a,
     - do bootchart/svg.c too,
     - remove unused MIN3.]
2013-04-01 23:43:48 -04:00
Zbigniew Jędrzejewski-Szmek 4dd1de72e8 Remove some dead code
Based on coverity report.
2013-03-31 14:28:36 -04:00
Zbigniew Jędrzejewski-Szmek 40c2cce772 bootchart: fix two unitialized memory frees
The new gcc isn't bad!

In file included from src/bootchart/svg.c:36:0:
src/bootchart/svg.c: In function 'svg_ps_bars':
./src/shared/util.h:524:13: warning: 'enc_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
         free(*(void**) p);
             ^
src/bootchart/svg.c:821:37: note: 'enc_name' was declared here
                 char _cleanup_free_*enc_name;
                                     ^
  CC     src/udev/mtd_probe/mtd_probe-probe_smartmedia.o
  XSLT     man/systemd.unit.5
In file included from src/bootchart/svg.c:36:0:
src/bootchart/svg.c: In function 'svg_pss_graph':
./src/shared/util.h:524:13: warning: 'enc_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
         free(*(void**) p);
             ^
src/bootchart/svg.c:395:37: note: 'enc_name' was declared here
                 char _cleanup_free_*enc_name;
                                     ^
2013-03-21 22:39:23 -04:00
Lennart Poettering 6d031c0b60 bootchart: various superficial cleanups
Let's update bootchar to share the coding style a bit more with the rest
of the package.

- Some tabs/spaces fixes

- add #pragma to header

- split up header so that we have a 1:1 relation between .c and .h files
  like everywhere else

- Prefix user command line arguments/configuration settings with "arg_".

- other coding style fixes
2013-03-11 22:47:58 +01:00
Zbigniew Jędrzejewski-Szmek 1f3523baf7 Revert "bootchart: use _cleanup_close_"
This reverts commit 0ea9530d40.

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).
2013-03-07 15:35:50 -05:00
Nathaniel Chen 0ea9530d40 bootchart: use _cleanup_close_
use _cleanup_{close_,fclose_} to close streams and file descriptors
2013-03-07 20:53:14 +01:00
Harald Hoyer b9a496c166 bootchart: rename global len to samples_len 2013-03-07 16:09:25 +01:00
Harald Hoyer e90f9fa4d1 bootchart: add parameter "-C" to expand process names to the full cmdline 2013-03-07 16:09:22 +01:00
Harald Hoyer 8846199d20 bootchart: if "root=/dev" is not matched, don't try to read /sys 2013-02-14 13:49:48 -08:00
Harald Hoyer e93450c6c0 bootchart: parse /etc/os-release rather than system-release
Also parse it early, so that we can get it in the initramfs.
2013-02-14 11:59:16 -08:00
Harald Hoyer b823b5e272 bootchart: more fixes for bootchart in the initramfs 2013-02-14 11:55:23 -08:00
William Giokas 895aeb2779 man: bootchart: change /var/log to /run/log
As of [1], bootchart stores files in /run/log, not /var/log, by default.

[1] f2f85884ca
2013-02-13 15:26:55 -08:00
William Giokas 6bb25a0582 bootchart: Fix typos and some English
bootchart.conf: direct users to `bootchart.conf(5)`, not a nonexistent
man page.

svg.c: Fix some English in the svg comment header.
  * Chrome/Chromium => Chrome, Chromium
  * firefox => Firefox
  * much more slow => more slowly
2013-02-13 05:03:48 +01:00
Auke Kok cd3bccaaf7 systemd-bootchart: relicense to LGPLv2.1+
When we merged systemd-bootchart we omitted relicensing this
to LGPL. Now that code is being used for other purposes we
need to make sure the code is shareable within systemd
without further problems.

The original committers and contributors of bootchart before it
was merged all have agreed with the relicensing.
2013-02-12 15:14:15 -08:00
Zbigniew Jędrzejewski-Szmek e985665d2d Add _cleanup_pclose_ and fix mismatching pipe close opened by popen()
Based-on-patch-by: Thomas Jarosch <thomas.jarosch@intra2net.com>

cppcheck reported:
[src/bootchart/svg.c:791]: (error) Mismatching allocation and deallocation: f
2013-01-25 10:38:42 -05:00
Thomas Hindoe Paaboel Andersen 28989b63f5 bootchart: tabs to spaces 2013-01-10 00:24:48 +01:00
Auke Kok 83fdc450aa bootchart: merge bootchart
Bootchart is renamed to 'systemd-bootchart' and installed as
/usr/lib/systemd/systemd-bootchart. The configuration file
will reside in /etc/systemd/bootchart.conf.
2013-01-07 23:48:43 +01:00