projects
/
blktrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0a1988
)
[PATCH] blktrace: fix possible crash on exit without ever opening an ofile
author
Jens Axboe
<axboe@suse.de>
Thu, 23 Feb 2006 13:51:17 +0000
(14:51 +0100)
committer
Jens Axboe
<axboe@suse.de>
Thu, 23 Feb 2006 13:51:17 +0000
(14:51 +0100)
blktrace.c
patch
|
blob
|
blame
|
history
diff --git
a/blktrace.c
b/blktrace.c
index 9aefac77c435c74a9b82533d13666ff983972eb6..cac2c38b0eece0eb559232f8f45239dd57c87d25 100644
(file)
--- a/
blktrace.c
+++ b/
blktrace.c
@@
-643,7
+643,7
@@
static void tip_ftrunc_final(struct thread_information *tip)
/*
* truncate to right size and cleanup mmap
*/
- if (tip->ofile_mmap) {
+ if (tip->ofile_mmap
&& tip->ofile
) {
int ofd = fileno(tip->ofile);
if (tip->fs_buf)
@@
-1382,7
+1382,8
@@
static void net_client_done(struct net_connection *nc)
for (j = 0; j < nc->ncpus; j++) {
tip = &dip->threads[j];
- fclose(tip->ofile);
+ if (tip->ofile)
+ fclose(tip->ofile);
}
free(dip->threads);