Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into mc
[simgrid.git] / src / mc / mc_unw_vmread.cpp
index 3893ec9..a4e5677 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 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 <sys/types.h>
 #include <sys/uio.h>
 
@@ -42,7 +48,6 @@ static int access_mem(const unw_addr_space_t as,
 {
   if (write)
     return - UNW_EINVAL;
-  ssize_t s;
   pid_t pid = _UPT_getpid(arg);
   size_t size = sizeof(unw_word_t);
 
@@ -52,7 +57,7 @@ static int access_mem(const unw_addr_space_t as,
 
   struct iovec local = { valp, size };
   struct iovec remote = { (void*) addr, size };
-  s = process_vm_readv(pid, &local, 1, &remote, 1, 0);
+  ssize_t s = process_vm_readv(pid, &local, 1, &remote, 1, 0);
   if (s >= 0) {
     if ((size_t) s != size)
       return - UNW_EINVAL;