From 03c70a8d81f14ce46bc3410b08f5956d6af34d82 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 27 Jun 2015 21:08:55 +0200 Subject: subprocess, lua: export whether the process was killed by us We want to distinguish actual errors, and just aborting the program intentionally. Also be a bit more careful with handling the wait() exit status: do not called WEXITSTATUS() without checking WIFEXITED() first. --- osdep/subprocess.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'osdep/subprocess.h') diff --git a/osdep/subprocess.h b/osdep/subprocess.h index 1bd5afe1f8..33c4013f6d 100644 --- a/osdep/subprocess.h +++ b/osdep/subprocess.h @@ -28,6 +28,8 @@ typedef void (*subprocess_read_cb)(void *ctx, char *data, size_t size); int mp_subprocess(char **args, struct mp_cancel *cancel, void *ctx, subprocess_read_cb on_stdout, subprocess_read_cb on_stderr, char **error); +// mp_subprocess return values. -1 is a generic error code. +#define MP_SUBPROCESS_EKILLED_BY_US -2 struct mp_log; void mp_subprocess_detached(struct mp_log *log, char **args); -- cgit v1.2.3