From: Martin Quinson Date: Thu, 13 Apr 2017 06:00:48 +0000 (+0200) Subject: Portability fun with FreeBSD X-Git-Tag: v3.16~358 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9197f939bdfb39f2c4746f47c16c5b9f630b12cc Portability fun with FreeBSD 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. --- diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 25518210f0..05216bfce3 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -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(fdin_size), target_executable.c_str()); const int bufsize = 1024 * 1024 * 4; char buf[bufsize]; while (int got = read(fdin, buf, bufsize)) {