From: Guillem Jover Date: Fri, 21 Mar 2008 19:57:11 +0000 (+0200) Subject: Remove duplicate cu_parsedb function and use cu_closefd instead X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b48df2ea3061a46247e1ca216f42e184270f70e;p=dpkg Remove duplicate cu_parsedb function and use cu_closefd instead --- diff --git a/ChangeLog b/ChangeLog index 87c50284..2bf8e4ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-21 Guillem Jover + + * lib/parse.c (cu_parsedb): Remove duplicate function. + (parsedb): Use cu_closefd instead of cu_parsedb. + 2008-03-21 Ian Jackson * src/archives.c (tarobject): Make 'fd' static. diff --git a/lib/parse.c b/lib/parse.c index 1075d740..3de8a614 100644 --- a/lib/parse.c +++ b/lib/parse.c @@ -76,8 +76,6 @@ const struct fieldinfo fieldinfos[]= { #define NFIELDS (sizeof(fieldinfos)/sizeof(struct fieldinfo)) const int nfields= NFIELDS; -static void cu_parsedb(int argc, void **argv) { close(*(int *)argv); } - int parsedb(const char *filename, enum parsedbflags flags, struct pkginfo **donep, FILE *warnto, int *warncount) { /* warnto, warncount and donep may be null. @@ -105,7 +103,7 @@ int parsedb(const char *filename, enum parsedbflags flags, fd= open(filename, O_RDONLY); if (fd == -1) ohshite(_("failed to open package info file `%.255s' for reading"),filename); - push_cleanup(cu_parsedb, ~ehflag_normaltidy, NULL, 0, 1, &fd); + push_cleanup(cu_closefd, ~ehflag_normaltidy, NULL, 0, 1, &fd); if (fstat(fd, &stat) == -1) ohshite(_("can't stat package info file `%.255s'"),filename);