Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sed -i -e 's/\t/ /g' [sources] Please people, stop using tabs
[simgrid.git] / teshsuite / msg / storage / concurrent_rw.c
index 32b0d7d..0e8c60a 100644 (file)
@@ -1,6 +1,8 @@
-/* Copyright (c) 2008-2010, 2012-2014. The SimGrid Team.
- * All rights reserved.
-*/
+/* Copyright (c) 2008-2010, 2012-2015. 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. */
 
 #include "simgrid/msg.h"
 #include "xbt/log.h"
@@ -56,9 +58,9 @@ void display_storage_properties(msg_storage_t storage){
   if (xbt_dict_length(props) > 0){
     XBT_INFO("\tProperties of mounted storage: %s", MSG_storage_get_name(storage));
     xbt_dict_foreach(props, cursor, key, data)
-         XBT_INFO("\t\t'%s' -> '%s'", key, data);
+    XBT_INFO("\t\t'%s' -> '%s'", key, data);
   }else{
-       XBT_INFO("\tNo property attached.");
+  XBT_INFO("\tNo property attached.");
   }
 }
 
@@ -95,16 +97,16 @@ void display_storage_content(msg_storage_t storage){
 
 int host(int argc, char *argv[])
 {
-       char name[2048];
-       sprintf(name,"%s%i", FILENAME1,MSG_process_self_PID());
-       msg_file_t file = MSG_file_open(name, NULL);
-       //MSG_file_read(file, MSG_file_get_size(file));
-       MSG_file_write(file, 500000);
+  char name[2048];
+  sprintf(name,"%s%i", FILENAME1,MSG_process_self_PID());
+  msg_file_t file = MSG_file_open(name, NULL);
+  //MSG_file_read(file, MSG_file_get_size(file));
+  MSG_file_write(file, 500000);
 
-       XBT_INFO("Size of %s: %llu", MSG_file_get_name(file), MSG_file_get_size(file));
-       MSG_file_close(file);
+  XBT_INFO("Size of %s: %llu", MSG_file_get_name(file), MSG_file_get_size(file));
+  MSG_file_close(file);
 
-       return 1;
+  return 1;
 }
 
 
@@ -118,7 +120,7 @@ int main(int argc, char **argv)
   MSG_function_register("host", host);
   storage_info(MSG_host_by_name(xbt_strdup("host")));
   for(i = 0 ; i<10; i++){
-       MSG_process_create(xbt_strdup("host"), host, NULL, MSG_host_by_name(xbt_strdup("host")));
+    MSG_process_create(xbt_strdup("host"), host, NULL, MSG_host_by_name(xbt_strdup("host")));
   }
 
 
@@ -128,9 +130,5 @@ int main(int argc, char **argv)
   storage_info(MSG_host_by_name(xbt_strdup("host")));
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
-  if (res == MSG_OK)
-    return 0;
-  else
-    return 1;
-
+  return res != MSG_OK;
 }