Fix two error paths
authorAndreas Gruenbacher <andreas.gruenbacher@gmail.com>
Wed, 9 Jul 2014 17:37:33 +0000 (19:37 +0200)
committerAndreas Gruenbacher <andreas.gruenbacher@gmail.com>
Wed, 9 Jul 2014 17:37:33 +0000 (19:37 +0200)
In generic_open_file(), when an error is detected, return 1 to indicate
the failure.

In get_file_sizes(), when an error other than ENOENT is detected, fail
immediately and don't clear the error.

filesetup.c

index 1facccd79f995021c03b80dead4a103b067c9189..39c276a3d2203180772a1e9a88974dc545d360fd 100644 (file)
@@ -609,6 +609,7 @@ open_again:
                }
 
                td_verror(td, __e, buf);
+               return 1;
        }
 
        if (!from_hash && f->fd != -1) {
@@ -661,6 +662,7 @@ static int get_file_sizes(struct thread_data *td)
                        if (td->error != ENOENT) {
                                log_err("%s\n", td->verror);
                                err = 1;
+                               break;
                        }
                        clear_error(td);
                }