+Sat Mar 10 15:59:39 CST 2001 Adam Heath <doogie@debian.org>
+
+ * main/filesdb.c: Use a pure file descriptor, instead of a stream, to
+ load the data, in ensure_packagefiles_available.
+
Sat Mar 10 01:33:15 CET 2001 Wichert Akkerman <wakkerma@debian.org>
* main/main,h, main/main.c: add --no-debsig option using f_nodebsign
void ensure_packagefiles_available(struct pkginfo *pkg) {
static struct varbuf fnvb;
- FILE *file;
+ int fd;
const char *filelistfile;
struct fileinlist **lendp, *newent, *current;
struct filepackages *packageslump;
onerr_abort++;
- file= fopen(filelistfile,"r");
+ fd= open(filelistfile,O_RDONLY);
- if (!file) {
+ if (fd==-1) {
if (errno != ENOENT)
ohshite(_("unable to open files list file for package `%.250s'"),pkg->name);
onerr_abort--;
return;
}
- push_cleanup(cu_closefile,ehflag_bombout, 0,0, 1,(void*)file);
+ push_cleanup(cu_closefd,ehflag_bombout, 0,0, 1,(void*)fd);
- if(fstat(fileno(file), &stat_buf))
+ if(fstat(fd, &stat_buf))
ohshite("unable to stat files list file for package `%.250s'",pkg->name);
loaded_list = nfmalloc(stat_buf.st_size);
loaded_list_end = loaded_list + stat_buf.st_size;
- fd_buf_copy(fileno(file), loaded_list, stat_buf.st_size, _("files list for package `%.250s'"), pkg->name);
+ fd_buf_copy(fd, loaded_list, stat_buf.st_size, _("files list for package `%.250s'"), pkg->name);
lendp= &pkg->clientdata->files;
thisline = loaded_list;
lendp= &newent->next;
thisline = nextline;
}
- pop_cleanup(ehflag_normaltidy); /* file= fopen() */
- if (fclose(file))
+ pop_cleanup(ehflag_normaltidy); /* fd= open() */
+ if (close(fd))
ohshite(_("error closing files list file for package `%.250s'"),pkg->name);
if (fnvb.used)
ohshit(_("files list file for package `%.250s' is truncated"),pkg->name);