Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Portability fun with FreeBSD
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 13 Apr 2017 06:00:48 +0000 (08:00 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 13 Apr 2017 06:00:52 +0000 (08:00 +0200)
Make sure that the lambda capture parameter is actually used when
sendfile(2) is not usable, to avoid a fatal warning: FreeBSD is both
super advanced (with clang being very uptodate) and somewhat
prehistorical.

And no, I do not plan to deal myself with the FreeBSD-specific
sendfile prototype to avoid this problem in a cleaner way. But patches
are welcome as usual.

src/smpi/smpi_global.cpp

index 2551821..05216bf 100644 (file)
@@ -549,6 +549,7 @@ int smpi_main(const char* executable, int argc, char *argv[])
 #if HAVE_SENDFILE
         sendfile(fdout, fdin, NULL, fdin_size);
 #else
+        XBT_WARN("Copy %d bytes into %s", static_cast<int>(fdin_size), target_executable.c_str());
         const int bufsize = 1024 * 1024 * 4;
         char buf[bufsize];
         while (int got = read(fdin, buf, bufsize)) {