Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
public headers should include simgrid in a system-wide way, not a project-wide one
[simgrid.git] / teshsuite / msg / io-file-remote / io-file-remote.c
index 3f05e6a..6b098a9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -6,6 +6,8 @@
 #include "simgrid/msg.h"
 #include <simgrid/plugins/file_system.h>
 
+#include <stdio.h> /* sscanf */
+
 #define INMEGA (1024 * 1024)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(remote_io, "Messages specific for this io example");
@@ -44,8 +46,8 @@ static int host(int argc, char* argv[])
       XBT_INFO("Copy '%s' (of size %llu) from '%s' to '%s'", filename, MSG_file_get_size(file), MSG_host_get_name(src),
                argv[3]);
       MSG_file_rcopy(file, dest, argv[4]);
-      MSG_file_close(file);
     }
+    MSG_file_close(file);
   }
 
   return 0;