diff options
author | ewt <devnull@localhost> | 1998-01-06 03:20:24 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1998-01-06 03:20:24 +0000 |
commit | 306172f60020c97064cc194492e28f86efc30f8d (patch) | |
tree | 2e01c98f99577de0c88fb09b61013919c1654cb6 /lib/package.c | |
parent | 2dfbef04161668639212170a47f35f679e9e717f (diff) | |
download | librpm-tizen-306172f60020c97064cc194492e28f86efc30f8d.tar.gz librpm-tizen-306172f60020c97064cc194492e28f86efc30f8d.tar.bz2 librpm-tizen-306172f60020c97064cc194492e28f86efc30f8d.zip |
0 length files are bad only if the files are regular ones -- it may be
fine for sockets
CVS patchset: 1916
CVS date: 1998/01/06 03:20:24
Diffstat (limited to 'lib/package.c')
-rw-r--r-- | lib/package.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/package.c b/lib/package.c index 9e288dc66..bde14bd8a 100644 --- a/lib/package.c +++ b/lib/package.c @@ -41,7 +41,8 @@ static int readPackageHeaders(int fd, struct rpmlead * leadPtr, oldLead = (struct oldrpmlead *) lead; fstat(fd, &sb); - if (sb.st_size < 4) return 1; + /* if fd points to a socket, pipe, etc, sb.st_size is *always* zero */ + if (S_ISREG(sb.st_mode) && sb.st_size < 4) return 1; if (readLead(fd, lead)) { return 2; |