From 852398f8c6dcb4ad5ed0310e49e7d342a262be91 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 15 Oct 2009 14:33:45 +0300 Subject: Lose unnecessary url type checking from fdSize() - we're only dealing with local files once fd is opened --- rpmio/rpmio.c | 17 ++--------------- 1 file 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; } -- cgit v1.2.3