/[gentoo-projects]/pax-utils/scanelf.c
Gentoo

Diff of /pax-utils/scanelf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.217 Revision 1.218
1/* 1/*
2 * Copyright 2003-2007 Gentoo Foundation 2 * Copyright 2003-2007 Gentoo Foundation
3 * Distributed under the terms of the GNU General Public License v2 3 * Distributed under the terms of the GNU General Public License v2
4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.217 2010/01/15 10:29:17 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.218 2010/01/15 11:56:15 vapier Exp $
5 * 5 *
6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10static const char *rcsid = "$Id: scanelf.c,v 1.217 2010/01/15 10:29:17 vapier Exp $"; 10static const char *rcsid = "$Id: scanelf.c,v 1.218 2010/01/15 11:56:15 vapier Exp $";
11const char * const argv0 = "scanelf"; 11const char * const argv0 = "scanelf";
12 12
13#include "paxinc.h" 13#include "paxinc.h"
14 14
15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') 15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
1447 ar = ar_open_fd(filename, fd); 1447 ar = ar_open_fd(filename, fd);
1448 if (ar == NULL) 1448 if (ar == NULL)
1449 return 1; 1449 return 1;
1450 1450
1451 ar_buffer = mmap(0, len, PROT_READ | (fix_elf ? PROT_WRITE : 0), (fix_elf ? MAP_SHARED : MAP_PRIVATE), fd, 0); 1451 ar_buffer = mmap(0, len, PROT_READ | (fix_elf ? PROT_WRITE : 0), (fix_elf ? MAP_SHARED : MAP_PRIVATE), fd, 0);
1452 while ((m=ar_next(ar)) != NULL) { 1452 while ((m = ar_next(ar)) != NULL) {
1453 off_t cur_pos = lseek(fd, 0, SEEK_CUR);
1454 if (cur_pos == -1)
1455 errp("lseek() failed");
1453 elf = readelf_buffer(m->name, ar_buffer+lseek(fd,0,SEEK_CUR), m->size); 1456 elf = readelf_buffer(m->name, ar_buffer + cur_pos, m->size);
1454 if (elf) { 1457 if (elf) {
1455 scanelf_elfobj(elf); 1458 scanelf_elfobj(elf);
1456 unreadelf(elf); 1459 unreadelf(elf);
1457 } 1460 }
1458 } 1461 }

Legend:
Removed from v.1.217  
changed lines
  Added in v.1.218

  ViewVC Help
Powered by ViewVC 1.1.20