Since the invention of read-only memory, write-only memory has been
considered deprecated. Where appropriate, either make use of the
value, or avoid writing it, to make it clear that it is not used.
size = strpcpyf(&ptr, size, "%s (userspace) ", format_timespan(ts, sizeof(ts), t->finish_time - t->userspace_time, USEC_PER_MSEC));
if (t->kernel_time > 0)
size = strpcpyf(&ptr, size, "%s (userspace) ", format_timespan(ts, sizeof(ts), t->finish_time - t->userspace_time, USEC_PER_MSEC));
if (t->kernel_time > 0)
- size = strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->firmware_time + t->finish_time, USEC_PER_MSEC));
+ strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->firmware_time + t->finish_time, USEC_PER_MSEC));
- size = strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->finish_time - t->userspace_time, USEC_PER_MSEC));
+ strpcpyf(&ptr, size, "= %s", format_timespan(ts, sizeof(ts), t->finish_time - t->userspace_time, USEC_PER_MSEC));
ptr = strdup(buf);
if (!ptr)
ptr = strdup(buf);
if (!ptr)
if (strv_contains(*units, *c)) {
r = list_dependencies_print("...", level + 1, (branches << 1) | (to_print ? 1 : 0),
true, NULL, boot);
if (strv_contains(*units, *c)) {
r = list_dependencies_print("...", level + 1, (branches << 1) | (to_print ? 1 : 0),
true, NULL, boot);
continue;
}
r = list_dependencies_one(bus, *c, level + 1, units,
(branches << 1) | (to_print ? 1 : 0));
continue;
}
r = list_dependencies_one(bus, *c, level + 1, units,
(branches << 1) | (to_print ? 1 : 0));
p = malloc(9 + BOOTCHART_MAX);
if (!p) {
p = malloc(9 + BOOTCHART_MAX);
if (!p) {
i = 1;
LIST_FOREACH_BEFORE(link, sampledata, head) {
int bottom;
i = 1;
LIST_FOREACH_BEFORE(link, sampledata, head) {
int bottom;
struct ps_sched_struct *prev_sample;
struct ps_sched_struct *cross_place;
struct ps_sched_struct *prev_sample;
struct ps_sched_struct *cross_place;
- bottom = 0;
- top = 0;
-
/* put all the small pss blocks into the bottom */
ps = ps_first->next_ps;
while (ps->next_ps) {
/* put all the small pss blocks into the bottom */
ps = ps_first->next_ps;
while (ps->next_ps) {
int max_here = 0;
int i;
int k;
int max_here = 0;
int i;
int k;
- struct list_sample_data *start_sampledata = sampledata;
- struct list_sample_data *stop_sampledata = sampledata;
+ struct list_sample_data *start_sampledata;
+ struct list_sample_data *stop_sampledata;
svg("<!-- IO utilization graph - In -->\n");
svg("<!-- IO utilization graph - In -->\n");
int stop;
int diff;
double tot;
int stop;
int diff;
double tot;
- double pbi;
-
- tot = 0;
- pbi = 0;
start = MAX(i - ((range / 2) - 1), 0);
stop = MIN(i + (range / 2), samples);
start = MAX(i - ((range / 2) - 1), 0);
stop = MIN(i + (range / 2), samples);
int max_here = 0;
int i;
int k;
int max_here = 0;
int i;
int k;
- struct list_sample_data *start_sampledata = sampledata;
- struct list_sample_data *stop_sampledata = sampledata;
+ struct list_sample_data *start_sampledata;
+ struct list_sample_data *stop_sampledata;
svg("<!-- IO utilization graph - out -->\n");
svg("<!-- IO utilization graph - out -->\n");
"PRETTY_NAME", &pretty_name,
"CPE_NAME", &cpe_name,
NULL);
"PRETTY_NAME", &pretty_name,
"CPE_NAME", &cpe_name,
NULL);
+ if (r < 0)
+ log_warning("Failed to read /etc/os-release: %s", strerror(-r));
if (!isempty(pretty_name))
printf(" Operating System: %s\n", pretty_name);
if (!isempty(pretty_name))
printf(" Operating System: %s\n", pretty_name);
coredump_bufsize = COREDUMP_MIN_START;
coredump_data = malloc(coredump_bufsize);
if (!coredump_data) {
coredump_bufsize = COREDUMP_MIN_START;
coredump_data = malloc(coredump_bufsize);
if (!coredump_data) {
+ log_warning("Failed to allocate memory for core, core will not be stored.");
n = loop_read(STDIN_FILENO, coredump_data + coredump_size,
coredump_bufsize - coredump_size, false);
if (n < 0) {
n = loop_read(STDIN_FILENO, coredump_data + coredump_size,
coredump_bufsize - coredump_size, false);
if (n < 0) {
- log_error("Failed to read core dump data: %s", strerror(-n));
+ log_error("Failed to read core data: %s", strerror(-n));
r = (int) n;
goto finish;
} else if (n == 0)
r = (int) n;
goto finish;
} else if (n == 0)
- if(coredump_size > COREDUMP_MAX) {
- log_error("Coredump too large, ignoring");
+ if (coredump_size > COREDUMP_MAX) {
+ log_error("Core too large, core will not be stored.");
goto finalize;
}
if (!GREEDY_REALLOC(coredump_data, coredump_bufsize, coredump_size + 1)) {
goto finalize;
}
if (!GREEDY_REALLOC(coredump_data, coredump_bufsize, coredump_size + 1)) {
+ log_warning("Failed to allocate memory for core, core will not be stored.");
finalize:
r = sd_journal_sendv(iovec, j);
if (r < 0)
finalize:
r = sd_journal_sendv(iovec, j);
if (r < 0)
- log_error("Failed to send coredump: %s", strerror(-r));
+ log_error("Failed to log coredump: %s", strerror(-r));
finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
/* we did truncate it to 6 */
r = sd_memfd_get_size(m, &sz);
/* we did truncate it to 6 */
r = sd_memfd_get_size(m, &sz);
+ assert_se(r >= 0 && sz == 6);
/* map it, check content */
r = sd_memfd_map(m, 0, 12, (void **)&s);
/* map it, check content */
r = sd_memfd_map(m, 0, 12, (void **)&s);
- r = manager_get_session_by_pid(m, leader, &session);
+ manager_get_session_by_pid(m, leader, &session);
if (session) {
_cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
_cleanup_free_ char *path = NULL;
if (session) {
_cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
_cleanup_free_ char *path = NULL;
}
static int compare_unit_file_list(const void *a, const void *b) {
}
static int compare_unit_file_list(const void *a, const void *b) {
-static int test_hwdb(struct udev *udev, const char *modalias) {
+static void test_hwdb(struct udev *udev, const char *modalias) {
struct udev_hwdb *hwdb;
struct udev_list_entry *entry;
struct udev_hwdb *hwdb;
struct udev_list_entry *entry;
printf("\n");
hwdb = udev_hwdb_unref(hwdb);
printf("\n");
hwdb = udev_hwdb_unref(hwdb);
}
int main(int argc, char *argv[])
}
int main(int argc, char *argv[])
udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, test, 0))
printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, test, 0))
printf("%s=%s\n", udev_list_entry_get_name(entry), udev_list_entry_get_value(entry));
- hwdb = udev_hwdb_unref(hwdb);