/[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.204 Revision 1.205
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.204 2008/12/30 13:09:20 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.205 2008/12/30 13:13: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.204 2008/12/30 13:09:20 vapier Exp $"; 10static const char *rcsid = "$Id: scanelf.c,v 1.205 2008/12/30 13:13: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 == '+')
103 103
104 path = xstrdup(path); 104 path = xstrdup(path);
105 while ((p = strrchr(path, ':')) != NULL) { 105 while ((p = strrchr(path, ':')) != NULL) {
106 snprintf(fullpath, sizeof(fullpath), "%s/%s", p + 1, fname); 106 snprintf(fullpath, sizeof(fullpath), "%s/%s", p + 1, fname);
107 *p = 0; 107 *p = 0;
108 if (access(fullpath, R_OK) != (-1)) { 108 if (access(fullpath, R_OK) != -1) {
109 free(path); 109 free(path);
110 return fullpath; 110 return fullpath;
111 } 111 }
112 } 112 }
113 free(path); 113 free(path);
1760 if (strcmp(optarg, "ELFCLASS64") == 0) 1760 if (strcmp(optarg, "ELFCLASS64") == 0)
1761 match_bits = 64; 1761 match_bits = 64;
1762 } 1762 }
1763 break; 1763 break;
1764 case 'O': 1764 case 'O':
1765 if (sscanf(optarg, "%o", &match_perms) == (-1)) 1765 if (sscanf(optarg, "%o", &match_perms) == -1)
1766 match_bits = 0; 1766 match_bits = 0;
1767 break; 1767 break;
1768 case 'o': { 1768 case 'o': {
1769 if (freopen(optarg, "w", stdout) == NULL) 1769 if (freopen(optarg, "w", stdout) == NULL)
1770 err("Could not open output stream '%s': %s", optarg, strerror(errno)); 1770 err("Could not open output stream '%s': %s", optarg, strerror(errno));

Legend:
Removed from v.1.204  
changed lines
  Added in v.1.205

  ViewVC Help
Powered by ViewVC 1.1.20