/[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.63 Revision 1.64
1/* 1/*
2 * Copyright 2003-2005 Gentoo Foundation 2 * Copyright 2003-2005 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.63 2005/05/29 18:44:48 solar Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.64 2005/05/29 19:42:09 solar Exp $
5 * 5 *
6 ******************************************************************** 6 ********************************************************************
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as 8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the 9 * published by the Free Software Foundation; either version 2 of the
33#include <dirent.h> 33#include <dirent.h>
34#include <getopt.h> 34#include <getopt.h>
35#include <assert.h> 35#include <assert.h>
36#include "paxelf.h" 36#include "paxelf.h"
37 37
38static const char *rcsid = "$Id: scanelf.c,v 1.63 2005/05/29 18:44:48 solar Exp $"; 38static const char *rcsid = "$Id: scanelf.c,v 1.64 2005/05/29 19:42:09 solar Exp $";
39#define argv0 "scanelf" 39#define argv0 "scanelf"
40 40
41 41
42 42
43/* prototypes */ 43/* prototypes */
789 __FILE__, __DATE__, rcsid, argv0); 789 __FILE__, __DATE__, rcsid, argv0);
790 exit(EXIT_SUCCESS); 790 exit(EXIT_SUCCESS);
791 break; 791 break;
792 case 'h': usage(EXIT_SUCCESS); break; 792 case 'h': usage(EXIT_SUCCESS); break;
793 case 'f': 793 case 'f':
794 if (from_file == NULL) 794 if (from_file) err("Don't specify -f twice");
795 from_file = xstrdup(optarg); 795 from_file = xstrdup(optarg);
796 else
797 err("Don't specify -f twice");
798 break; 796 break;
799 case 'o': { 797 case 'o': {
800 FILE *fp = NULL; 798 FILE *fp = NULL;
801 fp = freopen(optarg, "w", stdout); 799 if ((fp = freopen(optarg, "w", stdout)) == NULL)
802 if (fp == NULL)
803 err("Could not open output stream '%s': %s", optarg, strerror(errno)); 800 err("Could not open output stream '%s': %s", optarg, strerror(errno));
804 stdout = fp; 801 stdout = fp;
805 break; 802 break;
806 } 803 }
807 804
808 case 's': { 805 case 's': {
809 size_t len; 806 size_t len;
810 if (!find_sym)
811 err("Don't specify -s twice"); 807 if (find_sym) err("Don't specify -s twice");
812 find_sym = xstrdup(optarg); 808 find_sym = xstrdup(optarg);
813 len = strlen(find_sym) + 1; 809 len = strlen(find_sym) + 1;
814 versioned_symname = (char*)xmalloc(sizeof(char) * (len+1)); 810 versioned_symname = (char*)xmalloc(sizeof(char) * (len+1));
815 sprintf(versioned_symname, "%s@", find_sym); 811 sprintf(versioned_symname, "%s@", find_sym);
816 break; 812 break;
817 } 813 }
818 814
819 case 'F': { 815 case 'F': {
820 if (!out_format) 816 if (out_format) err("Don't specify -F twice");
821 out_format = xstrdup(optarg); 817 out_format = xstrdup(optarg);
822 else
823 err("Don't specify -F twice");
824 break; 818 break;
825 } 819 }
826 820
827 case 'y': scan_symlink = 0; break; 821 case 'y': scan_symlink = 0; break;
828 case 'B': show_banner = 0; break; 822 case 'B': show_banner = 0; break;

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64

  ViewVC Help
Powered by ViewVC 1.1.20