diff options
| author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-01-04 08:19:34 -0200 |
|---|---|---|
| committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-01-04 08:49:15 -0200 |
| commit | c68e92f73133d4220bc6dfe1ca960cf58da7a4b3 (patch) | |
| tree | 44f797f718e38bef885a99486795a5fdcb415931 /libkmod/libkmod-file.c | |
| parent | 29b69c0b98bdf43907206bfcdaadadcb4a1ea195 (diff) | |
| download | kmod-c68e92f73133d4220bc6dfe1ca960cf58da7a4b3.tar.gz | |
file: take a weakref to ctx
Diffstat (limited to 'libkmod/libkmod-file.c')
| -rw-r--r-- | libkmod/libkmod-file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libkmod/libkmod-file.c b/libkmod/libkmod-file.c index 809c7cd..4ea2a8d 100644 --- a/libkmod/libkmod-file.c +++ b/libkmod/libkmod-file.c @@ -55,6 +55,7 @@ struct kmod_file { off_t size; void *memory; const struct file_ops *ops; + const struct kmod_ctx *ctx; }; #ifdef ENABLE_XZ @@ -261,7 +262,8 @@ static const struct file_ops reg_ops = { load_reg, unload_reg }; -struct kmod_file *kmod_file_open(const char *filename) +struct kmod_file *kmod_file_open(const struct kmod_ctx *ctx, + const char *filename) { struct kmod_file *file = calloc(1, sizeof(struct kmod_file)); const struct comp_type *itr; @@ -312,6 +314,7 @@ struct kmod_file *kmod_file_open(const char *filename) file->ops = ®_ops; err = file->ops->load(file); + file->ctx = ctx; error: if (err < 0) { if (file->fd >= 0) |
