X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal-remote%2Fjournal-upload.c;h=e16204484e2a40e436ead0e5fa15f46ef957395e;hb=5e78424f4a27c07be50e246308035c877f204038;hp=5a30a29427189f405c6d3e15bcc090a729a0d542;hpb=dad29dff1925a114e20d4eb7b47fca23c4f25fd7;p=elogind.git diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 5a30a2942..e16204484 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -191,7 +191,7 @@ int start_upload(Uploader *u, easy_setopt(curl, CURLOPT_POST, 1L, LOG_ERR, return -EXFULL); - easy_setopt(curl, CURLOPT_ERRORBUFFER, &u->error, + easy_setopt(curl, CURLOPT_ERRORBUFFER, u->error, LOG_ERR, return -EXFULL); /* set where to write to */ @@ -324,7 +324,7 @@ static int dispatch_fd_input(sd_event_source *event, } static int open_file_for_upload(Uploader *u, const char *filename) { - int fd, r; + int fd, r = 0; if (streq(filename, "-")) fd = STDIN_FILENO; @@ -748,7 +748,7 @@ int main(int argc, char **argv) { log_parse_environment(); r = parse_config(); - if (r <= 0) + if (r < 0) goto finish; r = parse_argv(argc, argv); @@ -818,7 +818,10 @@ int main(int argc, char **argv) { } cleanup: - sd_notify(false, "STATUS=Shutting down..."); + sd_notify(false, + "STOPPING=1\n" + "STATUS=Shutting down..."); + destroy_uploader(&u); finish: