On Sun, Jul 14, 2013 at 09:23:53AM +0200, J??r??mie Courr??ges-Anglas wrote:
> David Hill <dh...@mindcry.org> writes:
> 
> > remove unused variables.
> 
> Makes sense.  ok?
> 
> > Index: ldconfig/prebind.c
> > ===================================================================
> > RCS file: /cvs/src/libexec/ld.so/ldconfig/prebind.c,v
> > retrieving revision 1.20
> > diff -u -p -r1.20 prebind.c
> > --- ldconfig/prebind.c      4 May 2013 09:23:33 -0000       1.20
> > +++ ldconfig/prebind.c      5 Jul 2013 18:18:24 -0000
> > @@ -472,12 +472,10 @@ done:
> >  int
> >  elf_check_note(void *buf, Elf_Phdr *phdr)
> >  {
> > -   Elf_Ehdr *ehdr;
> >     u_long address;
> >     u_int *pint;
> >     char *osname;
> >  
> > -   ehdr = (Elf_Ehdr *)buf;
> >     address = phdr->p_offset;
> >     pint = (u_int *)((char *)buf + address);
> >     osname = (char *)buf + address + sizeof(*pint) * 3;
> > @@ -1712,7 +1710,6 @@ elf_write_lib(struct elf_object *object,
> >     u_int32_t next_start, *fixuptab = NULL;
> >     struct stat ifstat;
> >     off_t base_offset;
> > -   size_t len;
> >     int fd = -1, i;
> >     int readonly = 0;
> >  
> > @@ -1729,7 +1726,7 @@ elf_write_lib(struct elf_object *object,
> >             readonly = 1;
> >     }
> >     lseek(fd, -((off_t)sizeof(struct prebind_footer)), SEEK_END);
> > -   len = read(fd, &footer, sizeof(struct prebind_footer));
> > +   read(fd, &footer, sizeof(struct prebind_footer));

Here I would consider actually using len to check for failure. And of
course changing the type of len to ssize_t to allow such checking.

.... Ken

> >  
> >     if (fstat(fd, &ifstat) == -1) {
> >             perror(object->load_name);
> > @@ -2210,7 +2207,6 @@ void
> >  copy_oldsymcache(int objidx, void *prebind_map)
> >  {
> >     struct prebind_footer *footer;
> > -   struct elf_object *object;
> >     struct elf_object *tobj;
> >     struct symcache_noflag *tcache;
> >     struct symcachetab *symcache;
> > @@ -2219,8 +2215,6 @@ copy_oldsymcache(int objidx, void *prebi
> >     u_int32_t offset;
> >     u_int32_t *poffset;
> >     struct nameidx *nameidx;
> > -
> > -   object = objarray[objidx].obj;
> >  
> >     poffset = (u_int32_t *)prebind_map;
> >     c = prebind_map;
> >
> 

Reply via email to