| Submitter | Ryota OZAKI |
|---|---|
| Date | March 20, 2010, 7:08 a.m. |
| Message ID | <1269068918-6163-1-git-send-email-ozaki.ryota@gmail.com> |
| Download | mbox | patch |
| Permalink | /patch/48203/ |
| State | New |
| Headers | show |
Comments
Ryota Ozaki <ozaki.ryota@gmail.com> writes: > bdrv_open may return -errno so we have to check > if the return value is '< 0', not '== -1'. Looks good, thanks!
On Sat, Mar 20, 2010 at 04:08:38PM +0900, Ryota Ozaki wrote: > bdrv_open may return -errno so we have to check > if the return value is '< 0', not '== -1'. Thanks, applied. > Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com> > --- > qemu-io.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/qemu-io.c b/qemu-io.c > index b2f2f5a..2f195bf 100644 > --- a/qemu-io.c > +++ b/qemu-io.c > @@ -1284,7 +1284,7 @@ static int openfile(char *name, int flags, int growable) > flags |= BDRV_O_FILE; > } > > - if (bdrv_open(bs, name, flags) == -1) { > + if (bdrv_open(bs, name, flags) < 0) { > fprintf(stderr, "%s: can't open device %s\n", progname, name); > bs = NULL; > return 1; > -- > 1.6.5.2 > > > >
Patch
diff --git a/qemu-io.c b/qemu-io.c index b2f2f5a..2f195bf 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1284,7 +1284,7 @@ static int openfile(char *name, int flags, int growable) flags |= BDRV_O_FILE; } - if (bdrv_open(bs, name, flags) == -1) { + if (bdrv_open(bs, name, flags) < 0) { fprintf(stderr, "%s: can't open device %s\n", progname, name); bs = NULL; return 1;
bdrv_open may return -errno so we have to check if the return value is '< 0', not '== -1'. Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com> --- qemu-io.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)