[thirdparty-commits] seanbright: editline/trunk r153 - in /editline/trunk/src: readline.c vi.c
SVN commits to the Digium third-party software repository
thirdparty-commits at lists.digium.com
Wed Mar 17 15:06:22 CDT 2010
Author: seanbright
Date: Wed Mar 17 15:06:18 2010
New Revision: 153
URL: http://svnview.digium.com/svn/thirdparty?view=rev&rev=153
Log:
Silence some warnings about warn_unused_result.
Modified:
editline/trunk/src/readline.c
editline/trunk/src/vi.c
Modified: editline/trunk/src/readline.c
URL: http://svnview.digium.com/svn/thirdparty/editline/trunk/src/readline.c?view=diff&rev=153&r1=152&r2=153
==============================================================================
--- editline/trunk/src/readline.c (original)
+++ editline/trunk/src/readline.c Wed Mar 17 15:06:18 2010
@@ -1271,7 +1271,8 @@
}
fflush(fp);
if((off = ftello(fp)) > 0)
- (void)ftruncate(fileno(fp), off);
+ if (ftruncate(fileno(fp), off) < 0)
+ goto out3;
out3:
fclose(tp);
out2:
Modified: editline/trunk/src/vi.c
URL: http://svnview.digium.com/svn/thirdparty/editline/trunk/src/vi.c?view=diff&rev=153&r1=152&r2=153
==============================================================================
--- editline/trunk/src/vi.c (original)
+++ editline/trunk/src/vi.c Wed Mar 17 15:06:18 2010
@@ -1014,8 +1014,16 @@
if (fd < 0)
return CC_ERROR;
cp = el->el_line.buffer;
- write(fd, cp, (size_t)(el->el_line.lastchar - cp));
- write(fd, "\n", 1);
+ if (write(fd, cp, (size_t)(el->el_line.lastchar - cp)) < 0) {
+ close(fd);
+ unlink(tempfile);
+ return CC_ERROR;
+ }
+ if (write(fd, "\n", 1) < 0) {
+ close(fd);
+ unlink(tempfile);
+ return CC_ERROR;
+ }
pid = fork();
switch (pid) {
case -1:
More information about the thirdparty-commits
mailing list