Handle failed system calls
Introduce a separate TU for utility functions util.c. Add a function exec_cmd to simplify execution of system commands with error handling. While at it, suppress a warning about unused result when executing a shell command. As we only display the command's output we do not care about the exit code. This fixes Debian bug #398989[0] [0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398989
This commit is contained in:
6
form.c
6
form.c
@@ -9,6 +9,7 @@
|
||||
#include "myctype.h"
|
||||
#include "local.h"
|
||||
#include "regex.h"
|
||||
#include "util.h"
|
||||
|
||||
extern Str *textarea_str;
|
||||
extern int max_textarea;
|
||||
@@ -603,9 +604,8 @@ input_textarea(FormItemList *fi)
|
||||
form_fputs_decode(fi->value, f);
|
||||
fclose(f);
|
||||
|
||||
fmTerm();
|
||||
system(myEditor(Editor, tmpf, 1)->ptr);
|
||||
fmInit();
|
||||
if (exec_cmd(myEditor(Editor, tmpf, 1)->ptr))
|
||||
goto input_end;
|
||||
|
||||
if (fi->readonly)
|
||||
goto input_end;
|
||||
|
Reference in New Issue
Block a user