Skip to content

Commit 4918136

Browse files
committedJan 25, 2016
Properly check for write errors in metrics FileEmitter.
1 parent 903aae1 commit 4918136

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎vm/metrics.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace rubinius {
7373
}
7474
}
7575

76-
if(write(fd_, "\n", 1)) {
76+
if(write(fd_, "\n", 1) < 0) {
7777
logger::error("%s: unable to write file metrics", strerror(errno));
7878
}
7979
}
@@ -97,7 +97,7 @@ namespace rubinius {
9797
}
9898
}
9999

100-
if(write(fd_, "\n", 1)) {
100+
if(write(fd_, "\n", 1) < 0) {
101101
logger::error("%s: unable to write file metrics", strerror(errno));
102102
}
103103
}

0 commit comments

Comments
 (0)
Please sign in to comment.