job_error.c 291 Bytes
Newer Older
Julian Rother's avatar
Julian Rother committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <stdlib.h>

#include "../util.h"

int jobid;

void job_failed(char *msg, ...)
{
	va_list ap;
	va_start(ap, msg);
	ping_job(jobid, "failed", "{\"reason\": \"%s\", \"log\": \"%s\"}",
			jescape(vmprintf(msg, ap)), jescape(get_avlogbuf()));
	va_end(ap);
	exit(2);
}