List:Commits« Previous MessageNext Message »
From:Nirbhay Choubey Date:April 26 2011 7:53am
Subject:bzr commit into mysql-5.1 branch (nirbhay.choubey:3650) Bug#12329909
View as plain text  
#At file:///home/nirbhay/Project/mysql/repo/bugs/mysql-5.1.12329909/ based on revid:nirbhay.choubey@stripped

 3650 Nirbhay Choubey	2011-04-26
      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.

    modified:
      cmd-line-utils/libedit/vi.c
=== modified file 'cmd-line-utils/libedit/vi.c'
--- a/cmd-line-utils/libedit/vi.c	2010-10-19 22:36:59 +0000
+++ b/cmd-line-utils/libedit/vi.c	2011-04-26 07:53:18 +0000
@@ -1012,8 +1012,19 @@ vi_histedit(EditLine *el, int c __attrib
 	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)
+        {
+          close(fd);
+          unlink(tempfile);
+          return CC_ERROR;
+        }
+	if (write(fd, "\n", 1) == -1)
+        {
+          close(fd);
+          unlink(tempfile);
+          return CC_ERROR;
+        }
+
 	pid = fork();
 	switch (pid) {
 	case -1:


Attachment: [text/bzr-bundle] bzr/nirbhay.choubey@oracle.com-20110426075318-s200rgrt7szgi88r.bundle
Thread
bzr commit into mysql-5.1 branch (nirbhay.choubey:3650) Bug#12329909Nirbhay Choubey26 Apr