A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't use xbt_assert for error checking.
[simgrid.git]
/
src
/
surf
/
storage_interface.cpp
diff --git
a/src/surf/storage_interface.cpp
b/src/surf/storage_interface.cpp
index
90e14c7
..
5e1ef73
100644
(file)
--- a/
src/surf/storage_interface.cpp
+++ b/
src/surf/storage_interface.cpp
@@
-98,8
+98,9
@@
xbt_dict_t Storage::parseContent(char *filename)
FILE *file = NULL;
file = surf_fopen(filename, "r");
FILE *file = NULL;
file = surf_fopen(filename, "r");
- xbt_assert(file != NULL, "Cannot open file '%s' (path=%s)", filename,
- xbt_str_join(surf_path, ":"));
+ if (file == NULL)
+ xbt_die("Cannot open file '%s' (path=%s)", filename,
+ xbt_str_join(surf_path, ":"));
char *line = NULL;
size_t len = 0;
char *line = NULL;
size_t len = 0;
@@
-107,10
+108,9
@@
xbt_dict_t Storage::parseContent(char *filename)
char path[1024];
sg_size_t size;
char path[1024];
sg_size_t size;
-
while ((read = xbt_getline(&line, &len, file)) != -1) {
if (read){
while ((read = xbt_getline(&line, &len, file)) != -1) {
if (read){
- if(sscanf(line,"%s %llu", path, &size) == 2) {
+
if(sscanf(line,"%s %llu", path, &size) == 2) {
m_usedSize += size;
sg_size_t *psize = xbt_new(sg_size_t, 1);
*psize = size;
m_usedSize += size;
sg_size_t *psize = xbt_new(sg_size_t, 1);
*psize = size;