From 1c1a85bf8e7dfcef99516123cc272b880f40abe8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 20 Feb 2007 20:47:29 +0000 Subject: [PATCH] preserve errors over closing files --- org.glite.jp.primary/src/attrs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.glite.jp.primary/src/attrs.c b/org.glite.jp.primary/src/attrs.c index b1906c6..cfdf91a 100644 --- a/org.glite.jp.primary/src/attrs.c +++ b/org.glite.jp.primary/src/attrs.c @@ -75,6 +75,8 @@ void process_files(glite_jp_context_t ctx, const char *job, glite_jp_attrval_t** char** names = NULL; int nnames = glite_jppsbe_get_names(ctx, job, class, &names); int n; + glite_jp_error_t *keep_err = NULL; + for (n = 0; n < nnames; n++) if (! glite_jppsbe_open_file(ctx,job,class, names[n], O_RDONLY, &beh)) { if (!plugin->ops.open(plugin->fpctx,beh,uri,&ph)) { @@ -89,9 +91,13 @@ void process_files(glite_jp_context_t ctx, const char *job, glite_jp_attrval_t** *nout = merge_attrvals(out,*nout,myattr); free(myattr); } + keep_err = ctx->error; ctx->error = NULL; plugin->ops.close(plugin->fpctx, ph); + if (keep_err) { ctx->error = keep_err; keep_err = NULL; } } + keep_err = ctx->error; ctx->error = NULL; glite_jppsbe_close_file(ctx,beh); + if (keep_err) { ctx->error = keep_err; keep_err = NULL; } } } -- 1.8.2.3