treat 0 as valid file descriptor

The descriptor is openned in rpmpkgOpen, and we treat 0 as valid file descriptor.
Here we should do the same or fail earlier.
This commit is contained in:
licunlong 2022-01-20 19:59:44 +08:00 committed by Florian Festi
parent b0795abfd1
commit be64821b90
1 changed files with 1 additions and 1 deletions

View File

@ -734,7 +734,7 @@ static int rpmpkgAddSlotPage(rpmpkgdb pkgdb)
static int rpmpkgGetLock(rpmpkgdb pkgdb, int type)
{
if (!pkgdb->fd)
if (pkgdb->fd < 0)
return RPMRC_FAIL;
if (flock(pkgdb->fd, type))
return RPMRC_FAIL;