diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Program.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/Program.hpp b/include/Program.hpp index f164180..4007a24 100644 --- a/include/Program.hpp +++ b/include/Program.hpp @@ -4,10 +4,10 @@ #include <sys/types.h> #include <thread> -typedef struct { - pid_t pid; - int read_fd; -} ReadProgram; +struct ReadProgram { + pid_t pid = -1; + int read_fd = -1; +}; /* Return 0 if you want to continue reading. @data is null-terminated */ typedef int (*ProgramOutputCallback)(char *data, int size, void *userdata); @@ -23,7 +23,7 @@ int exec_program_pipe(const char **args, ReadProgram *read_program); and the last which is NULL, which indicates end of args. |buffer_size| has to be between 1 and 65536. */ -int exec_program(const char **args, ProgramOutputCallback output_callback, void *userdata, int buffer_size = 4096); +int exec_program(const char **args, ProgramOutputCallback output_callback, void *userdata, int buffer_size = 16384); // Return the exit status, or a negative value if waiting failed int wait_program(pid_t process_id); |