Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add/update copyright notices.
[simgrid.git] / src / bindings / java / smx_context_cojava.c
index 6ecaca1..fd064e8 100644 (file)
@@ -1,12 +1,11 @@
 /* context_cojava - implementation of context switching for java coroutines */
 
-/* Copyright 2012. The SimGrid Team.
+/* Copyright (c) 2012-2014. 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 <xbt/function_types.h>
 #include <simgrid/simix.h>
 #include <xbt/ex.h>
@@ -264,7 +263,7 @@ static void smx_ctx_cojava_create_coroutine(smx_ctx_cojava_t context) {
      FILE *conf= fopen("/proc/sys/vm/max_map_count","r");
      if (conf) {
        int limit=-1;
-        if(!fscanf(conf,"%d",&limit))
+        if(fscanf(conf,"%d",&limit) != 1)
            xbt_die("Error while creating a new coroutine. Parse error.");
        fclose(conf);
        if (limit!=-1 && SIMIX_process_count() > (limit - 100) /2)