tree-wide: drop spurious newlines (#8764)

Double newlines (i.e. one empty lines) are great to structure code. But
let's avoid triple newlines (i.e. two empty lines), quadruple newlines,
quintuple newlines, …, that's just spurious whitespace.

It's an easy way to drop 121 lines of code, and keeps the coding style
of our sources a bit tigther.
This commit is contained in:
Lennart Poettering 2018-04-19 12:13:23 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 6360b8ff83
commit 5d13a15b1d
91 changed files with 40 additions and 121 deletions

View File

@ -565,7 +565,6 @@
</variablelist>
</refsect1>
<refsect1>
<title>Unprivileged Write Access</title>

View File

@ -70,7 +70,6 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SplitMode=</varname></term>

View File

@ -276,7 +276,6 @@
seconds.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SyncIntervalSec=</varname></term>

View File

@ -114,7 +114,6 @@ int main(int argc, char **argv) {
}
</programlisting>
<para><function>SD_ID128_CONST_STR()</function> may be used to
convert constant 128-bit IDs into constant strings for output. The
following example code will output the string

View File

@ -106,7 +106,6 @@
errno-style error code.</para>
</refsect1>
<refsect1>
<title>Errors</title>

View File

@ -53,7 +53,6 @@
<paramdef>char **<parameter>ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>

View File

@ -147,7 +147,6 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--save-state</option><optional>=<replaceable>PATH</replaceable></optional></term>

View File

@ -353,7 +353,6 @@ CapabilityBoundingSet=~CAP_B CAP_C</programlisting>
</variablelist>
</refsect1>
<refsect1>
<title>Security</title>
@ -746,7 +745,6 @@ CapabilityBoundingSet=~CAP_B CAP_C</programlisting>
</variablelist>
</refsect1>
<refsect1>
<title>Sandboxing</title>
@ -2637,5 +2635,4 @@ StandardInputData=SWNrIHNpdHplIGRhIHVuJyBlc3NlIEtsb3BzLAp1ZmYgZWVtYWwga2xvcHAncy
</para>
</refsect1>
</refentry>

View File

@ -1369,7 +1369,6 @@
</variablelist>
</refsect1>
<refsect1>
<title>[DHCPServer] Section Options</title>
<para>The <literal>[DHCPServer]</literal> section contains

View File

@ -263,7 +263,6 @@
suffix.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>Persistent=</varname></term>

View File

@ -118,7 +118,6 @@ struct host_info {
char *architecture;
};
static int acquire_systemd_bus(sd_bus **bus) {
bool user = arg_scope != UNIT_FILE_SYSTEM;
@ -565,7 +564,6 @@ static int pretty_boot_time(sd_bus *bus, char **_buf) {
else if (!unit_id)
size = strpcpyf(&ptr, size, "\ncould not find default.target");
ptr = strdup(buf);
if (!ptr)
return log_oom();

View File

@ -855,7 +855,6 @@ static const char *table_data_format(TableData *d) {
assert_not_reached("Unexpected type?");
}
return d->formatted;
}

View File

@ -24,7 +24,6 @@ const struct hash_ops string_hash_ops = {
.compare = string_compare_func
};
void path_hash_func(const void *p, struct siphash *state) {
const char *q = p;
size_t n;

View File

@ -856,7 +856,6 @@ const char *mount_propagation_flags_to_string(unsigned long flags) {
return NULL;
}
int mount_propagation_flags_from_string(const char *name, unsigned long *ret) {
if (isempty(name))

View File

@ -109,7 +109,6 @@ void initialize_srand(void) {
#endif
x = 0;
x ^= (unsigned) now(CLOCK_REALTIME);
x ^= (unsigned) gettid();

View File

@ -5,7 +5,6 @@
Copyright 2010 Lennart Poettering
***/
#include <sys/time.h>
#include "macro.h"

View File

@ -315,7 +315,6 @@ char* mac_selinux_free(char *label) {
if (!mac_selinux_use())
return NULL;
freecon(label);
#endif

View File

@ -664,7 +664,6 @@ int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_
return -EOPNOTSUPP;
}
*ret = p;
return 0;
}
@ -1127,7 +1126,6 @@ int flush_accept(int fd) {
};
int r;
/* Similar to flush_fd() but flushes all incoming connection by accepting them and immediately closing them. */
for (;;) {

View File

@ -188,7 +188,6 @@ typedef struct tdEFI_TCG2_PROTOCOL {
EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS GetResultOfSetActivePcrBanks;
} EFI_TCG2;
static EFI_STATUS tpm1_measure_to_pcr_and_event_log(const EFI_TCG *tcg, UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer,
UINTN buffer_size, const CHAR16 *description) {
EFI_STATUS status;

View File

@ -544,7 +544,6 @@ static int parse_xml_node(Context *context, const char *prefix, unsigned n_depth
break;
case STATE_SIGNAL_ARG:
if (t == XML_ATTRIBUTE_NAME) {

View File

@ -1462,7 +1462,6 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char
break;
}
case SD_BUS_TYPE_DOUBLE: {
double z;
@ -1980,7 +1979,6 @@ static int parse_argv(int argc, char *argv[]) {
arg_expect_reply = !!r;
break;
case ARG_AUTO_START:
r = parse_boolean(optarg);
if (r < 0) {
@ -1991,7 +1989,6 @@ static int parse_argv(int argc, char *argv[]) {
arg_auto_start = !!r;
break;
case ARG_ALLOW_INTERACTIVE_AUTHORIZATION:
r = parse_boolean(optarg);
if (r < 0) {

View File

@ -5,7 +5,6 @@
Copyright 2012 Lennart Poettering
***/
#include <errno.h>
#include "audit-fd.h"

View File

@ -1692,7 +1692,6 @@ static void unit_remove_from_cgroup_realize_queue(Unit *u) {
u->in_cgroup_realize_queue = false;
}
/* Check if necessary controllers and attributes for a unit are in place.
*
* If so, do nothing.

View File

@ -100,7 +100,6 @@ static int property_get_oom_score_adjust(
void *userdata,
sd_bus_error *error) {
ExecContext *c = userdata;
int32_t n;
@ -130,7 +129,6 @@ static int property_get_nice(
void *userdata,
sd_bus_error *error) {
ExecContext *c = userdata;
int32_t n;
@ -159,7 +157,6 @@ static int property_get_ioprio(
void *userdata,
sd_bus_error *error) {
ExecContext *c = userdata;
assert(bus);
@ -178,7 +175,6 @@ static int property_get_ioprio_class(
void *userdata,
sd_bus_error *error) {
ExecContext *c = userdata;
assert(bus);
@ -197,7 +193,6 @@ static int property_get_ioprio_priority(
void *userdata,
sd_bus_error *error) {
ExecContext *c = userdata;
assert(bus);

View File

@ -33,7 +33,6 @@ static int property_get_listen(
void *userdata,
sd_bus_error *error) {
Socket *s = SOCKET(userdata);
SocketPort *p;
int r;
@ -79,7 +78,6 @@ static int property_get_listen(
return sd_bus_message_close_container(reply);
}
static int property_get_fdname(
sd_bus *bus,
const char *path,

View File

@ -4839,7 +4839,6 @@ int exec_runtime_deserialize_compat(Unit *u, const char *key, const char *value,
} else
return 0;
/* If the object is newly created, then put it to the hashmap which manages ExecRuntime objects. */
if (rt_create) {
r = hashmap_put(u->manager->exec_runtime_by_id, rt_create->id, rt_create);

View File

@ -563,7 +563,6 @@ int job_run_and_invalidate(Job *j) {
job_set_state(j, JOB_RUNNING);
job_add_to_dbus_queue(j);
switch (j->type) {
case JOB_VERIFY_ACTIVE: {

View File

@ -198,7 +198,6 @@ static int killall(int sig, Set *pids, bool send_sighup) {
make sure to only send this after SIGTERM so
that SIGTERM is always first in the queue. */
if (get_ctty_devnr(pid, NULL) >= 0)
/* it's OK if the process is gone, just ignore the result */
(void) kill(pid, SIGHUP);

View File

@ -5,7 +5,6 @@
Copyright 2010 Lennart Poettering
***/
#include "conf-parser.h"
#include "fs-util.h"
#include "load-dropin.h"

View File

@ -1166,7 +1166,6 @@ int config_parse_exec_cpu_sched_policy(const char *unit,
void *data,
void *userdata) {
ExecContext *c = data;
int x;
@ -1458,7 +1457,6 @@ int config_parse_exec_mount_flags(
void *data,
void *userdata) {
ExecContext *c = data;
int r;

View File

@ -920,7 +920,6 @@ int transaction_add_job_and_dependencies(
"Job type %s is not applicable for unit %s.",
job_type_to_string(type), unit->id);
/* First add the job. */
ret = transaction_add_one_job(tr, type, unit, &is_new);
if (!ret)

View File

@ -111,7 +111,6 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
path_startswith(p, "/proc"))
continue;
/* If we are in a container, don't attempt to
* read-only mount anything as that brings no real
* benefits, but might confuse the host, as we remount

View File

@ -3592,7 +3592,6 @@ void unit_deserialize_skip(FILE *f) {
}
}
int unit_add_node_dependency(Unit *u, const char *what, bool wants, UnitDependency dep, UnitDependencyMask mask) {
Unit *device;
_cleanup_free_ char *e = NULL;

View File

@ -160,7 +160,6 @@ static int create_disk(
"RequiresMountsFor=%s\n",
u_escaped);
r = generator_write_timeouts(arg_dest, device, name, options, &filtered);
if (r < 0)
return r;

View File

@ -248,7 +248,6 @@ static char* context_fallback_icon_name(Context *c) {
return strdup("computer");
}
static bool hostname_is_useful(const char *hn) {
return !isempty(hn) && !is_localhost(hn);
}

View File

@ -835,7 +835,6 @@ static int request_handler(
if (!streq(method, "GET"))
return mhd_respond(connection, MHD_HTTP_NOT_ACCEPTABLE, "Unsupported method.");
if (!*connection_cls) {
if (!request_meta(connection_cls))
return respond_oom(connection);

View File

@ -686,7 +686,6 @@ static int setup_microhttpd_server(RemoteServer *s,
log_debug("Started MHD %s daemon on fd:%d (wrapper @ %p)",
key ? "HTTPS" : "HTTP", fd, d);
info = MHD_get_daemon_info(d->daemon, MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY);
if (!info) {
log_error("µhttp returned NULL daemon info");
@ -1577,7 +1576,6 @@ int main(int argc, char **argv) {
if (r <= 0)
return r == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
if (arg_listen_http || arg_listen_https) {
r = setup_gnutls_logger(arg_gnutls_log);
if (r < 0)

View File

@ -167,8 +167,6 @@ static int load_cursor_state(Uploader *u) {
return 0;
}
int start_upload(Uploader *u,
size_t (*input_callback)(void *ptr,
size_t size,

View File

@ -33,7 +33,6 @@ void microhttpd_logger(void *arg, const char *fmt, va_list ap) {
REENABLE_WARNING;
}
static int mhd_respond_internal(struct MHD_Connection *connection,
enum MHD_RequestTerminationCode code,
const char *buffer,

View File

@ -681,7 +681,6 @@ static void dump_catalog_entry(FILE *f, sd_id128_t id, const char *s, bool oneli
SD_ID128_FORMAT_VAL(id), s);
}
int catalog_list(FILE *f, const char *database, bool oneline) {
_cleanup_close_ int fd = -1;
void *p = NULL;

View File

@ -117,7 +117,6 @@ int compress_blob_lz4(const void *src, uint64_t src_size,
#endif
}
int decompress_blob_xz(const void *src, uint64_t src_size,
void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max) {
@ -231,7 +230,6 @@ int decompress_blob(int compression,
return -EBADMSG;
}
int decompress_startswith_xz(const void *src, uint64_t src_size,
void **buffer, size_t *buffer_size,
const void *prefix, size_t prefix_len,

View File

@ -716,7 +716,6 @@ static int parse_argv(int argc, char *argv[]) {
arg_action = ACTION_SETUP_KEYS;
break;
case ARG_VERIFY_KEY:
arg_action = ACTION_VERIFY;
r = free_and_strdup(&arg_verify_key, optarg);
@ -969,7 +968,6 @@ static int parse_argv(int argc, char *argv[]) {
arg_system_units = strv_free(arg_system_units);
}
#if HAVE_PCRE2
if (arg_pattern) {
unsigned flags;
@ -1644,7 +1642,6 @@ static int add_priorities(sd_journal *j) {
return 0;
}
static int add_syslog_identifier(sd_journal *j) {
int r;
char **i;

View File

@ -167,7 +167,6 @@ static void patch_min_use(JournalStorage *storage) {
storage->metrics.min_use = MAX(storage->metrics.min_use, storage->space.vfs_used);
}
static int determine_space(Server *s, uint64_t *available, uint64_t *limit) {
JournalStorage *js;
int r;

View File

@ -214,7 +214,6 @@ uint32_t initval) /* the previous hash, or an arbitrary value */
return c;
}
/*
--------------------------------------------------------------------
hashword2() -- same as hashword(), but take two seeds and return two
@ -260,7 +259,6 @@ uint32_t *pb) /* IN: more seed OUT: secondary hash value */
*pc=c; *pb=b;
}
/*
-------------------------------------------------------------------------------
hashlittle() -- hash a variable-length key into a 32-bit value
@ -458,7 +456,6 @@ uint32_t jenkins_hashlittle( const void *key, size_t length, uint32_t initval)
return c;
}
/*
* hashlittle2: return 2 32-bit hash values
*
@ -644,8 +641,6 @@ void jenkins_hashlittle2(
*pc=c; *pb=b;
}
/*
* hashbig():
* This is the same as hashword() on big-endian machines. It is different
@ -775,7 +770,6 @@ uint32_t jenkins_hashbig( const void *key, size_t length, uint32_t initval)
return c;
}
#ifdef SELF_TEST
/* used for timings */
@ -967,7 +961,6 @@ void driver3()
uint8_t buf[1];
uint32_t h,i,state[HASHSTATE];
buf[0] = ~0;
for (i=0; i<HASHSTATE; ++i) state[i] = 1;
printf("These should all be different\n");
@ -999,7 +992,6 @@ void driver5()
printf("hash is %.8lx\n", c); /* cd628161 */
}
int main()
{
driver1(); /* test that the key is hashed: used for timings */

View File

@ -328,7 +328,6 @@ int lldp_neighbor_parse(sd_lldp_neighbor *n) {
break;
}
p += length, left -= length;
}

View File

@ -379,7 +379,6 @@ int config_parse_bridge_port_priority(
return 0;
}
void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) {
unsigned i;

View File

@ -571,7 +571,6 @@ static int test_client_verify_request(DHCP6Message *request, size_t len) {
assert_se(!found_iana);
found_iana = true;
assert_se(optlen == 40);
assert_se(!memcmp(optval, &test_iaid, sizeof(test_iaid)));

View File

@ -116,7 +116,6 @@ _public_ sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c) {
sd_bus_message_unref(m);
}
return NULL;
}
@ -209,7 +208,6 @@ _public_ int sd_bus_creds_get_suid(sd_bus_creds *c, uid_t *suid) {
return 0;
}
_public_ int sd_bus_creds_get_fsuid(sd_bus_creds *c, uid_t *fsuid) {
assert_return(c, -EINVAL);
assert_return(fsuid, -EINVAL);

View File

@ -894,7 +894,6 @@ int bus_match_parse(
components[n_components].value_u8 = u;
n_components++;
if (q[quoted] == 0)
break;

View File

@ -3221,7 +3221,6 @@ end:
return 0;
}
static int message_peek_body(
sd_bus_message *m,
size_t *rindex,
@ -5315,7 +5314,6 @@ int bus_message_parse_fields(sd_bus_message *m) {
break;
case BUS_MESSAGE_HEADER_SIGNATURE: {
const char *s;
char *c;

View File

@ -96,7 +96,6 @@ static int signature_element_length_internal(
return -EINVAL;
}
int signature_element_length(const char *s, size_t *l) {
return signature_element_length_internal(s, true, 0, 0, l);
}

View File

@ -157,7 +157,6 @@ void bus_slot_disconnect(sd_bus_slot *slot) {
key.interface = slot->node_vtable.interface;
key.member = v->x.method.member;
x = hashmap_remove(slot->bus->vtable_properties, &key);
break;
}}

View File

@ -3677,7 +3677,6 @@ _public_ int sd_bus_default_system(sd_bus **ret) {
return bus_default(sd_bus_open_system, &default_system_bus, ret);
}
_public_ int sd_bus_default_user(sd_bus **ret) {
return bus_default(sd_bus_open_user, &default_user_bus, ret);
}

View File

@ -298,7 +298,6 @@ int sd_netlink_message_append_u8(sd_netlink_message *m, unsigned short type, uin
return 0;
}
int sd_netlink_message_append_u16(sd_netlink_message *m, unsigned short type, uint16_t data) {
int r;

View File

@ -107,7 +107,6 @@ static void test_link_get(sd_netlink *rtnl, int ifindex) {
assert_se((r = sd_netlink_message_unref(r)) == NULL);
}
static void test_address_get(sd_netlink *rtnl, int ifindex) {
sd_netlink_message *m;
sd_netlink_message *r;

View File

@ -343,7 +343,6 @@ static int method_set_locale(sd_bus_message *m, void *userdata, sd_bus_error *er
} else
log_debug("Locale settings were not modified.");
return sd_bus_reply_method_return(m, NULL);
}

View File

@ -254,7 +254,6 @@ int session_save(Session *s) {
if (s->desktop) {
_cleanup_free_ char *escaped;
escaped = cescape(s->desktop);
if (!escaped) {
r = -ENOMEM;

View File

@ -1062,7 +1062,6 @@ static int show_pool_info(sd_bus *bus) {
return 0;
}
static int show_image_properties(sd_bus *bus, const char *path, bool *new_line) {
int r;

View File

@ -6,7 +6,6 @@
Copyright 2014 Tom Gundersen
***/
#include "netdev/dummy.h"
const NetDevVTable dummy_vtable = {

View File

@ -150,7 +150,6 @@ static int netdev_geneve_create(NetDev *netdev) {
log_netdev_debug(netdev, "Creating");
return r;
}

View File

@ -315,7 +315,6 @@ static void resolve_endpoints(NetDev *netdev) {
}
}
static int netdev_wireguard_post_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
Wireguard *w;
@ -455,7 +454,6 @@ int config_parse_wireguard_preshared_key(const char *unit,
peer->preshared_key);
}
int config_parse_wireguard_public_key(const char *unit,
const char *filename,
unsigned line,

View File

@ -1150,7 +1150,6 @@ static int link_enter_set_addresses(Link *link) {
log_link_warning_errno(link, r, "Failed to set DNS server for DHCP server, ignoring: %m");
}
if (link->network->dhcp_server_emit_ntp) {
if (link->network->n_dhcp_server_ntp > 0)

View File

@ -1897,7 +1897,6 @@ static int reset_audit_loginuid(void) {
return 0;
}
static int setup_propagate(const char *root) {
const char *p, *q;
int r;

View File

@ -181,7 +181,6 @@ int main(int argc, char* argv[]) {
} else
r = list_homes();
finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}

View File

@ -130,7 +130,6 @@ int resolvconf_parse_argv(int argc, char *argv[]) {
{}
};
enum {
TYPE_REGULAR,
TYPE_PRIVATE, /* -p: Not supported, treated identically to TYPE_REGULAR */

View File

@ -1232,7 +1232,6 @@ ssize_t dns_resource_record_payload(DnsResourceRecord *rr, void **out) {
*out = rr->tlsa.data;
return rr->tlsa.data_size;
case DNS_TYPE_OPENPGPKEY:
default:
*out = rr->generic.data;

View File

@ -678,7 +678,6 @@ static int dns_transaction_dnssec_ready(DnsTransaction *t) {
dns_transaction_complete(t, DNS_TRANSACTION_DNSSEC_FAILED);
return 0;
default:
log_debug("Auxiliary DNSSEC RR query failed with %s", dns_transaction_state_to_string(dt->state));
goto fail;
@ -1225,7 +1224,6 @@ static usec_t transaction_get_resend_timeout(DnsTransaction *t) {
assert(t);
assert(t->scope);
switch (t->scope->protocol) {
case DNS_PROTOCOL_DNS:

View File

@ -1098,7 +1098,6 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
} else
d = s;
r = sd_bus_message_append(m, "(ssbt)", s, d, ignore_enoent, flags);
if (r < 0)
return bus_log_create_error(r);

View File

@ -206,7 +206,6 @@ int fdset_new_listen_fds(FDSet **_s, bool unset) {
*_s = s;
return 0;
fail:
if (s)
set_free(MAKE_SET(s));

View File

@ -168,7 +168,6 @@ int fw_add_local_dnat(
uint16_t remote_port,
const union in_addr_union *previous_remote) {
_cleanup_(iptc_freep) struct xtc_handle *h = NULL;
struct ipt_entry *entry, *mask;
struct ipt_entry_target *t;

View File

@ -42,7 +42,6 @@ int import_url_last_component(const char *url, char **ret) {
return 0;
}
int import_url_change_last_component(const char *url, const char *suffix, char **ret) {
const char *e;
char *s;

View File

@ -52,7 +52,6 @@ static int print_catalog(FILE *f, sd_journal *j) {
int r;
_cleanup_free_ char *t = NULL, *z = NULL;
r = sd_journal_get_catalog(j, &t);
if (r < 0)
return r;
@ -84,7 +83,6 @@ static int parse_field(const void *data, size_t length, const char *field, size_
nl = length - field_len;
buf = newdup_suffix0(char, (const char*) data + field_len, nl);
if (!buf)
return log_oom();

View File

@ -275,7 +275,6 @@ int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
return write_utmp_wtmp(&store, &store_wtmp);
}
int utmp_put_runlevel(int runlevel, int previous) {
struct utmpx store = {};
int r;

View File

@ -1478,7 +1478,6 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
}
}
switch (action[0]) {
case ADD_RANGE:

View File

@ -236,7 +236,6 @@ const gather_stdout_callback_t gather_stdout[] = {
gather_stdout_three,
};
static void test_stdout_gathering(void) {
char template[] = "/tmp/test-exec-util.XXXXXXX";
const char *dirs[] = {template, NULL};

View File

@ -561,7 +561,6 @@ static void test_search_and_fopen(void) {
assert_se(r < 0);
}
static void test_search_and_fopen_nulstr(void) {
const char dirs[] = "/tmp/foo/bar\0/tmp\0";
char name[] = "/tmp/test-search_and_fopen.XXXXXX";

View File

@ -83,6 +83,5 @@ int main(int argc, char*argv[]) {
}
}
return 0;
}

View File

@ -394,7 +394,6 @@ int main(int argc, char *argv[]) {
assert_not_reached("Unhandled option code.");
}
/* add sys path if needed */
if (!startswith(syspath, "/sys"))
syspath = strjoina("/sys/", syspath);

View File

@ -5,7 +5,6 @@
Copyright 2014 Ronny Chevalier
***/
#include "locale-util.h"
#include "macro.h"
#include "strv.h"

View File

@ -181,7 +181,6 @@ static void test_gethostbyname4_r(void *handle, const char *module, const char *
}
}
static void test_gethostbyname3_r(void *handle, const char *module, const char *name, int af) {
const char *fname;
_nss_gethostbyname3_r_t f;
@ -401,7 +400,6 @@ static int test_one_module(const char* dir,
char **name;
int i;
log_info("======== %s ========", module);
handle = open_handle(streq(module, "dns") ? NULL : dir,

View File

@ -662,7 +662,6 @@ static void test_parse_nice(void) {
assert_se(parse_nice("19", &n) >= 0 && n == 19);
assert_se(parse_nice("+19", &n) >= 0 && n == 19);
assert_se(parse_nice("", &n) == -EINVAL);
assert_se(parse_nice("-", &n) == -EINVAL);
assert_se(parse_nice("+", &n) == -EINVAL);

View File

@ -102,7 +102,6 @@ static void check_stop_unlink(Manager *m, Unit *unit, const char *test_path, con
service_state_to_string(service->state),
service_result_to_string(service->result));
/* But we timeout if the service has not been started in the allocated time */
n = now(CLOCK_MONOTONIC);
if (ts + timeout < n) {

View File

@ -48,7 +48,6 @@ static void test_is_symlink(void) {
assert_se(is_symlink(name_link) == 1);
assert_se(is_symlink("/a/file/which/does/not/exist/i/guess") < 0);
unlink(name);
unlink(name_link);
}

View File

@ -135,7 +135,6 @@ static void test_strrep(void) {
assert_se(streq(zero, ""));
}
static void test_strappend(void) {
_cleanup_free_ char *t1, *t2, *t3, *t4;

View File

@ -89,7 +89,6 @@ static const char* const input_table_one_empty[] = {
NULL,
};
static void test_strv_find(void) {
assert_se(strv_find((char **)input_table_multiple, "three"));
assert_se(!strv_find((char **)input_table_multiple, "four"));

View File

@ -383,7 +383,6 @@ static void test_config_parse_exec(void) {
c1 = c1->command_next;
check_execcommand(c1, "/bin/grep", NULL, "\\w+\\K", NULL, false);
log_info("/* trailing backslash: \\ */");
/* backslash is invalid */
r = config_parse_exec(NULL, "fake", 4, "section", 1,

View File

@ -412,7 +412,6 @@ static void test_unit_name_escape(void) {
assert_se(streq(r, "ab\\x2b\\x2dc.a-bc\\x40foo.service"));
}
static void test_u_n_t_one(const char *name, const char *expected, int ret) {
_cleanup_free_ char *f = NULL;

View File

@ -35,7 +35,6 @@ static const uint8_t cis_signature[] = {
0x01, 0x03, 0xD9, 0x01, 0xFF, 0x18, 0x02, 0xDF, 0x01, 0x20
};
void probe_smart_media(int mtd_fd, mtd_info_t* info) {
int sector_size;
int block_size;

View File

@ -603,7 +603,6 @@ static int check_fill_0x83_prespc3(struct udev *udev,
return 0;
}
/* Get device identification VPD page */
static int do_scsi_page83_inquiry(struct udev *udev,
struct scsi_id_device *dev_scsi, int fd,

View File

@ -1740,8 +1740,6 @@ int main(int argc, char *argv[]) {
log_warning_errno(r, "Failed to redirect standard streams to /dev/null: %m");
}
pid = fork();
switch (pid) {
case 0:

40
tools/find-double-newline.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1+
case "$1" in
recdiff)
if [ "$2" = "" ] ; then
DIR="$PWD/.."
else
DIR="$2"
fi
find $DIR -type f \( -name '*.c' -o -name '*.xml' \) -exec $0 diff \{\} \;
;;
recpatch)
if [ "$2" = "" ] ; then
DIR="$PWD/.."
else
DIR="$2"
fi
find $DIR -type f \( -name '*.c' -o -name '*.xml' \) -exec $0 patch \{\} \;
;;
diff)
T=`mktemp`
sed '/^$/N;/^\n$/D' < "$2" > "$T"
diff -u "$2" "$T"
rm -f "$T"
;;
patch)
sed -i '/^$/N;/^\n$/D' "$2"
;;
*)
echo "Expected recdiff|recpatch|diff|patch as verb." >&2
;;
esac