Explorar o código

Quiet the libelf warning about unused result

Bryan Drewery %!s(int64=11) %!d(string=hai) anos
pai
achega
4a308a4a56
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      lib/libelf/lib/update.c

+ 4 - 1
lib/libelf/lib/update.c

@@ -914,7 +914,10 @@ _elf_output(Elf *elf, int fd, size_t len, off_t (*_elf_write)(Elf*, char*, size_
 
 
     elf_assert(len);
     elf_assert(len);
 #if HAVE_FTRUNCATE
 #if HAVE_FTRUNCATE
-    ftruncate(fd, 0);
+    if (ftruncate(fd, 0)) {
+	seterr(ERROR_IO_WRITE);
+	return -1;
+    }
 #endif /* HAVE_FTRUNCATE */
 #endif /* HAVE_FTRUNCATE */
 #if HAVE_MMAP
 #if HAVE_MMAP
     /*
     /*