diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-10-15 14:33:45 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-16 12:54:35 +0300 |
commit | 852398f8c6dcb4ad5ed0310e49e7d342a262be91 (patch) | |
tree | a55034917c23fa770e5172b1790ad72f53ef1242 /rpmio | |
parent | ec68fc79551b27821bb400eb0136f8416b9ccb2a (diff) | |
download | librpm-tizen-852398f8c6dcb4ad5ed0310e49e7d342a262be91.tar.gz librpm-tizen-852398f8c6dcb4ad5ed0310e49e7d342a262be91.tar.bz2 librpm-tizen-852398f8c6dcb4ad5ed0310e49e7d342a262be91.zip |
Lose unnecessary url type checking from fdSize()
- we're only dealing with local files once fd is opened
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/rpmio.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 4fb9ecee0..ca97a22ca 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -321,22 +321,9 @@ off_t fdSize(FD_t fd) struct stat sb; off_t rc = -1; -#ifdef NOISY -DBGIO(0, (stderr, "==>\tfdSize(%p) rc %ld\n", fd, (long)rc)); -#endif FDSANE(fd); - switch (fd->urlType) { - case URL_IS_PATH: - case URL_IS_UNKNOWN: - if (fstat(Fileno(fd), &sb) == 0) - rc = sb.st_size; - case URL_IS_HTTPS: - case URL_IS_HTTP: - case URL_IS_HKP: - case URL_IS_FTP: - case URL_IS_DASH: - break; - } + if (fstat(Fileno(fd), &sb) == 0) + rc = sb.st_size; return rc; } |