1
0
mirror of https://github.com/systemd/systemd synced 2025-11-08 11:24:45 +01:00

Compare commits

..

No commits in common. "87afd40b5a926e303c188855a167ee21c3124528" and "640ebaa9526ddfdb73feac464707bbac49c83a46" have entirely different histories.

8 changed files with 29 additions and 52 deletions

View File

@ -760,9 +760,3 @@ mouse:usb:v3057p0001:*
MOUSE_DPI=400@125 *800@125 1600@125 3200@125 400@500 800@500 1600@500 3200@500 400@1000 800@1000 1600@1000 3200@1000
MOUSE_WHEEL_CLICK_COUNT=16
MOUSE_WHEEL_CLICK_ANGLE=23
# Zowie ZA12
mouse:usb:v1af3p0001:name:Kingsis Peripherals ZOWIE Gaming mouse:
MOUSE_DPI=400@125 *800@125 1600@125 3200@125 400@500 800@500 1600@500 3200@500 400@1000 800@1000 1600@1000 3200@1000
MOUSE_WHEEL_CLICK_COUNT=16
MOUSE_WHEEL_CLICK_ANGLE=23

View File

@ -872,7 +872,7 @@
<constant>SIGKILL</constant> are considered clean service terminations.</para>
</example>
<para>Note: <command>systemd-analyze exit-status</command> may be used to list exit
<para>Note: <command>systemd-analyze exit-codes</command> may be used to list exit
codes and translate between numerical code values and names.</para></listitem>
</varlistentry>

View File

@ -199,14 +199,15 @@ tomorrow Pacific/Auckland → Thu 2012-11-23 19:00:00
continuous weekdays. <literal>,</literal> and <literal>..</literal>
may be combined freely.</para>
<para>In the date and time specifications, any component may be specified as <literal>*</literal> in
which case any value will match. Alternatively, each component can be specified as a list of values
separated by commas. Values may be suffixed with <literal>/</literal> and a repetition value, which
indicates that the value itself and the value plus all multiples of the repetition value are matched.
Two values separated by <literal>..</literal> may be used to indicate a range of values; ranges may also
be followed with <literal>/</literal> and a repetition value, in which case the expression matches all
times starting with the start value, and continuing with all multiples of the repetition value relative
to the start value, ending at the end value the latest.</para>
<para>In the date and time specifications, any component may be
specified as <literal>*</literal> in which case any value will
match. Alternatively, each component can be specified as a list of
values separated by commas. Values may be suffixed with
<literal>/</literal> and a repetition value, which indicates that
the value itself and the value plus all multiples of the repetition value
are matched. Two values separated by <literal>..</literal> may be used
to indicate a range of values; ranges may also be followed with
<literal>/</literal> and a repetition value.</para>
<para>A date specification may use <literal>~</literal> to indicate the
last day(s) in a month. For example, <literal>*-02~03</literal> means

View File

@ -30,9 +30,6 @@
* linked compenents anyway. */
#define CALENDARSPEC_COMPONENTS_MAX 240
/* Let's make sure that the microsecond component is safe to be stored in an 'int' */
assert_cc(INT_MAX >= USEC_PER_SEC);
static void chain_free(CalendarComponent *c) {
CalendarComponent *n;
@ -91,16 +88,6 @@ static void normalize_chain(CalendarComponent **c) {
if (i->stop > i->start && i->repeat > 0)
i->stop -= (i->stop - i->start) % i->repeat;
/* If a repeat value is specified, but it cannot even be triggered once, let's suppress
* it.
*
* Similar, if the stop value is the same as the start value, then let's just make this a
* non-repeating chain element */
if ((i->stop > i->start && i->repeat > 0 && i->start + i->repeat > i->stop) ||
i->start == i->stop) {
i->repeat = 0;
i->stop = -1;
}
}
if (n <= 1)
@ -175,7 +162,7 @@ int calendar_spec_normalize(CalendarSpec *c) {
return 0;
}
static bool chain_valid(CalendarComponent *c, int from, int to, bool end_of_month) {
_pure_ static bool chain_valid(CalendarComponent *c, int from, int to, bool end_of_month) {
assert(to >= from);
if (!c)
@ -379,13 +366,14 @@ int calendar_spec_to_string(const CalendarSpec *c, char **p) {
}
r = fflush_and_check(f);
fclose(f);
if (r < 0) {
free(buf);
fclose(f);
return r;
}
fclose(f);
*p = buf;
return 0;
}
@ -655,12 +643,6 @@ static int prepend_component(const char **p, bool usec, unsigned nesting, Calend
if (repeat == 0)
return -ERANGE;
} else {
/* If no repeat value is specified for the µs component, then let's explicitly refuse ranges
* below 1s because our default repeat granularity is beyond that. */
if (usec && stop >= 0 && start + repeat > stop)
return -EINVAL;
}
if (!IN_SET(*e, 0, ' ', ',', '-', '~', ':'))

View File

@ -19,9 +19,9 @@ typedef struct CalendarComponent {
typedef struct CalendarSpec {
int weekdays_bits;
bool end_of_month:1;
bool utc:1;
signed int dst:2;
bool end_of_month;
bool utc;
int dst;
char *timezone;
CalendarComponent *year;

View File

@ -158,7 +158,7 @@ static bool print_multiline(
bool audit,
const char* message,
size_t message_len,
size_t highlight[2]) {
size_t highlight[static 2]) {
const char *color_on = "", *color_off = "", *highlight_on = "";
const char *pos, *end;
@ -370,7 +370,7 @@ static int output_short(
unsigned n_columns,
OutputFlags flags,
Set *output_fields,
const size_t highlight[2]) {
const size_t highlight[static 2]) {
int r;
const void *data;
@ -534,7 +534,7 @@ static int output_verbose(
unsigned n_columns,
OutputFlags flags,
Set *output_fields,
const size_t highlight[2]) {
const size_t highlight[static 2]) {
const void *data;
size_t length;
@ -653,7 +653,7 @@ static int output_export(
unsigned n_columns,
OutputFlags flags,
Set *output_fields,
const size_t highlight[2]) {
const size_t highlight[static 2]) {
sd_id128_t boot_id;
char sid[SD_ID128_STRING_MAX];
@ -883,7 +883,7 @@ static int output_json(
unsigned n_columns,
OutputFlags flags,
Set *output_fields,
const size_t highlight[2]) {
const size_t highlight[static 2]) {
char sid[SD_ID128_STRING_MAX], usecbuf[DECIMAL_STR_MAX(usec_t)];
_cleanup_(json_variant_unrefp) JsonVariant *object = NULL;
@ -1021,7 +1021,7 @@ static int output_cat_field(
sd_journal *j,
OutputFlags flags,
const char *field,
const size_t highlight[2]) {
const size_t highlight[static 2]) {
const char *highlight_on, *highlight_off;
const void *data;
@ -1074,7 +1074,7 @@ static int output_cat(
unsigned n_columns,
OutputFlags flags,
Set *output_fields,
const size_t highlight[2]) {
const size_t highlight[static 2]) {
const char *field;
Iterator iterator;
@ -1104,7 +1104,7 @@ static int (*output_funcs[_OUTPUT_MODE_MAX])(
unsigned n_columns,
OutputFlags flags,
Set *output_fields,
const size_t highlight[2]) = {
const size_t highlight[static 2]) = {
[OUTPUT_SHORT] = output_short,
[OUTPUT_SHORT_ISO] = output_short,
@ -1130,7 +1130,7 @@ int show_journal_entry(
unsigned n_columns,
OutputFlags flags,
char **output_fields,
const size_t highlight[2],
const size_t highlight[static 2],
bool *ellipsized) {
int ret;

View File

@ -20,7 +20,7 @@ int show_journal_entry(
unsigned n_columns,
OutputFlags flags,
char **output_fields,
const size_t highlight[2],
const size_t highlight[static 2],
bool *ellipsized);
int show_journal(
FILE *f,

View File

@ -185,8 +185,6 @@ int main(int argc, char* argv[]) {
test_one("@1493187147 UTC", "2017-04-26 06:12:27 UTC");
test_one("@0", "1970-01-01 00:00:00 UTC");
test_one("@0 UTC", "1970-01-01 00:00:00 UTC");
test_one("*:05..05", "*-*-* *:05:00");
test_one("*:05..10/6", "*-*-* *:05:00");
test_next("2016-03-27 03:17:00", "", 12345, 1459048620000000);
test_next("2016-03-27 03:17:00", "CET", 12345, 1459041420000000);
@ -239,6 +237,8 @@ int main(int argc, char* argv[]) {
assert_se(calendar_spec_from_string("*~29", &c) < 0);
assert_se(calendar_spec_from_string("*~16..31", &c) < 0);
assert_se(calendar_spec_from_string("12..1/2-*", &c) < 0);
assert_se(calendar_spec_from_string("*:05..05", &c) < 0);
assert_se(calendar_spec_from_string("*:05..10/6", &c) < 0);
assert_se(calendar_spec_from_string("20/4:00", &c) < 0);
assert_se(calendar_spec_from_string("00:00/60", &c) < 0);
assert_se(calendar_spec_from_string("00:00:2300", &c) < 0);