Commit Graph

23 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 2fe21124a6 Add open_memstream_unlocked() wrapper 2019-04-12 11:44:57 +02:00
Yu Watanabe daa4aca1cb calendarspec: fix possible integer overflow
Fixes oss-fuzz#14108.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14108
2019-04-08 00:50:07 +09:00
Yu Watanabe fb3ba5ec11 calendarspec: use _cleanup_ attributes for CalendarComponent 2019-04-08 00:50:02 +09:00
Yu Watanabe 9eef82e5a8 calendarspec: rename free_chain() to chain_free() 2019-04-08 00:21:37 +09:00
Yu Watanabe 4122b14b3a calendarspec: use structured initializers 2019-04-08 00:18:54 +09:00
Lennart Poettering 2b2fec7db0 util: split out errno related stuff 2019-03-14 13:25:51 +01:00
Lennart Poettering 760877e90c util: split out sorting related calls to new sort-util.[ch] 2019-03-13 12:16:43 +01:00
Zbigniew Jędrzejewski-Szmek ea53cfd195 shared/calendarspec: do not allocate a big string on stack
The string can be as long as a logical line in a unit file — so no unlimited,
but quite big. Let's use a normal heap allocation when making a copy.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13125
2019-02-16 23:31:07 +01:00
Zbigniew Jędrzejewski-Szmek d284b82b3e Move various files that don't need to be in basic/ to shared/
This doesn't have much effect on the final build, because we link libbasic.a
into libsystemd-shared.so, so in the end, all the object built from basic/
end up in libsystemd-shared. And when the static library is linked into binaries,
any objects that are included in it but are not used are trimmed. Hence, the
size of output artifacts doesn't change:

$ du -sb /var/tmp/inst*
54181861	/var/tmp/inst1    (old)
54207441	/var/tmp/inst1s   (old split-usr)
54182477	/var/tmp/inst2    (new)
54208041	/var/tmp/inst2s   (new split-usr)

(The negligible change in size is because libsystemd-shared.so is bigger
by a few hundred bytes. I guess it's because symbols are named differently
or something like that.)

The effect is on the build process, in particular partial builds. This change
effectively moves the requirements on some build steps toward the leaves of the
dependency tree. Two effects:
- when building items that do not depend on libsystemd-shared, we
  build less stuff for libbasic.a (which wouldn't be used anyway,
  so it's a net win).
- when building items that do depend on libshared, we reduce libbasic.a as a
  synchronization point, possibly allowing better parallelism.

Method:
1. copy list of .h files from src/basic/meson.build to /tmp/basic
2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less
2018-11-20 07:27:37 +01:00
Kay Sievers a095315b3c build-sys: split internal basic/ library from shared/
basic/      can be used by everything
            cannot use anything outside of basic/

libsystemd/ can use basic/
            cannot use shared/

shared/     can use libsystemd/
2015-06-11 10:52:46 +02:00
Lennart Poettering 5b99bc57f2 shared: untabify 2015-02-10 12:34:11 +01:00
Daniele Medri 489464d0a2 calendarspec: add constant for weekdays_bits 2014-11-01 14:39:47 -04:00
Lennart Poettering dbfd41e2df calendarspec: parse 'quarterly' and 'semi-annually' as shortcuts 2014-10-27 18:09:26 +01:00
Daniele Medri 272ac20517 calendar: new case 'minutely' 2014-10-27 13:42:02 +01:00
Zbigniew Jędrzejewski-Szmek e90efc7090 calendarspec: fix typo in "annually"
https://bugs.freedesktop.org/show_bug.cgi?id=85447
2014-10-25 11:59:36 -04:00
Lennart Poettering 0b76b4d8c2 calendar: make freeing a calendar spec object deal fine with NULL
In order to make object destruction easier (in particular in combination
with _cleanup_) we usually make destructors deal with NULL objects as
NOPs. Change the calendar spec destructor to follow the same scheme.
2014-10-24 18:33:29 +02:00
Lennart Poettering 5ba6e0949c time: support @ syntax for denoting times since the UNIX epoch 1970-1-1 2014-03-25 04:08:16 +01:00
Lennart Poettering 135168183e calendar: support 'yearly' and 'annually' names the same way as cron 2013-11-20 19:36:14 +01:00
Zbigniew Jędrzejewski-Szmek 44a6b1b680 Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function
calls assert. It is assumed that the assert won't trigger,
and even if it does, it can only trigger on the first call
with a given set of parameters, and we don't care if the
compiler moves the order of calls.
2013-05-02 22:52:09 -04:00
Zbigniew Jędrzejewski-Szmek 8333c77edf Always use errno > 0 to help gcc
gcc thinks that errno might be negative, and functions could return
something positive on error (-errno). Should not matter in practice,
but makes an -O4 build much quieter.
2013-03-29 10:12:41 -04:00
Thomas Hindoe Paaboel Andersen b43d1d01ea util: introduce strcaseeq/strncaseeq 2013-02-13 00:56:13 +01:00
Lennart Poettering 660ddc72f6 Make gcc a bit quieter 2013-01-04 23:26:20 +01:00
Lennart Poettering 36697dc019 timer: implement calendar time events 2012-11-23 21:37:58 +01:00