#include "macro.h"
#include "strv.h"
#include "fileio.h"
-#include "socket-util.h"
#include "microhttpd-util.h"
#ifdef HAVE_GNUTLS
if (r < 0)
return log_oom();
} else {
- r = is_dir(arg_output);
+ r = is_dir(arg_output, true);
if (r > 0) {
r = asprintf(&output,
"%s/remote-%s.journal", arg_output, name);
typedef struct RemoteServer {
RemoteSource **sources;
- ssize_t sources_size;
- ssize_t active;
+ size_t sources_size;
+ size_t active;
sd_event *events;
sd_event_source *sigterm_event, *sigint_event, *listen_event;
assert(fd >= 0);
assert(source);
- if (!GREEDY_REALLOC0_T(s->sources, s->sources_size, fd + 1))
+ if (!GREEDY_REALLOC0(s->sources, s->sources_size, fd + 1))
return log_oom();
if (s->sources[fd] == NULL) {
RemoteSource *source;
assert(s);
- assert(fd >= 0);
- assert(fd < s->sources_size);
+ assert(fd >= 0 && fd < (ssize_t) s->sources_size);
source = s->sources[fd];
if (source) {
static int server_destroy(RemoteServer *s) {
int r;
- ssize_t i;
+ size_t i;
MHDDaemonWrapper *d;
r = writer_close(&s->writer);
RemoteSource *source;
int r;
- assert(fd < s->sources_size);
+ assert(fd >= 0 && fd < (ssize_t) s->sources_size);
source = s->sources[fd];
assert(source->fd == fd);
if (remoteserver_init(&s) < 0)
return EXIT_FAILURE;
- log_debug("%s running as pid %lu",
- program_invocation_short_name, (unsigned long) getpid());
+ log_debug("%s running as pid "PID_FMT,
+ program_invocation_short_name, getpid());
sd_notify(false,
"READY=1\n"
"STATUS=Processing requests...");