Mercurial > geeqie
diff src/exif.c @ 855:0c3f6ef17d18
Tidy up.
author | zas_ |
---|---|
date | Wed, 25 Jun 2008 20:53:52 +0000 |
parents | f606e8962329 |
children | 6ca2c5fd7b13 |
line wrap: on
line diff
--- a/src/exif.c Wed Jun 25 20:22:02 2008 +0000 +++ b/src/exif.c Wed Jun 25 20:53:52 2008 +0000 @@ -1104,7 +1104,8 @@ int fd; struct stat fs; - if ((fd = open(path, O_RDONLY)) == -1) + fd = open(path, O_RDONLY); + if (fd == -1) { perror(path); return -1; @@ -1119,7 +1120,8 @@ *size = fs.st_size; - if ((*mapping = mmap(0, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0)) == MAP_FAILED) + *mapping = mmap(0, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); + if (*mapping == MAP_FAILED) { perror(path); close(fd); @@ -1180,8 +1182,8 @@ exif->items = NULL; exif->current = NULL; - if ((res = exif_jpeg_parse(exif, (unsigned char *)f, size, - ExifKnownMarkersList)) == -2) + res = exif_jpeg_parse(exif, (unsigned char *)f, size, ExifKnownMarkersList); + if (res == -2) { res = exif_tiff_parse(exif, (unsigned char *)f, size, ExifKnownMarkersList); }