mirror of
https://github.com/MariaDB/server.git
synced 2026-04-24 17:25:31 +02:00
BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT
FAILS WITH LIBEDIT
Fixed by checking the return value of the write()
function calls and handling the open files and fd
appropriately.
cmd-line-utils/libedit/vi.c:
BUG#12329909 - BUILDING MYSQL WITH DEBUG SUPPORT
FAILS WITH LIBEDIT
Added a check on the return value of the write()
function calls.
This commit is contained in:
parent
a60c39a2ff
commit
a1f7ceb281
1 changed files with 10 additions and 2 deletions
|
|
@ -1012,8 +1012,10 @@ vi_histedit(EditLine *el, int c __attribute__((__unused__)))
|
|||
if (fd < 0)
|
||||
return CC_ERROR;
|
||||
cp = el->el_line.buffer;
|
||||
write(fd, cp, el->el_line.lastchar - cp +0u);
|
||||
write(fd, "\n", 1);
|
||||
if (write(fd, cp, el->el_line.lastchar - cp +0u) == -1)
|
||||
goto error;
|
||||
if (write(fd, "\n", 1) == -1)
|
||||
goto error;
|
||||
pid = fork();
|
||||
switch (pid) {
|
||||
case -1:
|
||||
|
|
@ -1041,6 +1043,12 @@ vi_histedit(EditLine *el, int c __attribute__((__unused__)))
|
|||
unlink(tempfile);
|
||||
/* return CC_REFRESH; */
|
||||
return ed_newline(el, 0);
|
||||
|
||||
/* XXXMYSQL: Avoid compiler warnings. */
|
||||
error:
|
||||
close(fd);
|
||||
unlink(tempfile);
|
||||
return CC_ERROR;
|
||||
}
|
||||
|
||||
/* vi_history_word():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue