diff options
-rw-r--r-- | litmus/fdso.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/litmus/fdso.c b/litmus/fdso.c index cd85b9cd9a0a..250377d184e7 100644 --- a/litmus/fdso.c +++ b/litmus/fdso.c | |||
@@ -166,6 +166,18 @@ static int put_od_entry(struct od_table_entry* od) | |||
166 | return 0; | 166 | return 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | static long close_od_entry(struct od_table_entry *od) | ||
170 | { | ||
171 | long ret; | ||
172 | |||
173 | /* Give the class a chance to reject the close. */ | ||
174 | ret = fdso_close(od); | ||
175 | if (ret == 0) | ||
176 | ret = put_od_entry(od); | ||
177 | |||
178 | return ret; | ||
179 | } | ||
180 | |||
169 | void exit_od_table(struct task_struct* t) | 181 | void exit_od_table(struct task_struct* t) |
170 | { | 182 | { |
171 | int i; | 183 | int i; |
@@ -173,7 +185,7 @@ void exit_od_table(struct task_struct* t) | |||
173 | if (t->od_table) { | 185 | if (t->od_table) { |
174 | for (i = 0; i < MAX_OBJECT_DESCRIPTORS; i++) | 186 | for (i = 0; i < MAX_OBJECT_DESCRIPTORS; i++) |
175 | if (t->od_table[i].used) | 187 | if (t->od_table[i].used) |
176 | put_od_entry(t->od_table + i); | 188 | close_od_entry(t->od_table + i); |
177 | kfree(t->od_table); | 189 | kfree(t->od_table); |
178 | t->od_table = NULL; | 190 | t->od_table = NULL; |
179 | } | 191 | } |
@@ -287,11 +299,7 @@ asmlinkage long sys_od_close(int od) | |||
287 | return ret; | 299 | return ret; |
288 | 300 | ||
289 | 301 | ||
290 | /* give the class a chance to reject the close | 302 | ret = close_od_entry(t->od_table + od); |
291 | */ | ||
292 | ret = fdso_close(t->od_table + od); | ||
293 | if (ret == 0) | ||
294 | ret = put_od_entry(t->od_table + od); | ||
295 | 303 | ||
296 | return ret; | 304 | return ret; |
297 | } | 305 | } |