* setpci.c (main): Don't crash when an invalid width is specified.
+ * lspci.c, setpci.c, common.c: die() now uses the right program
+ name when printing an error message.
+
2006-05-19 Martin Mares <mj@ucw.cz>
* README: Mention the public GIT tree.
/*
* The PCI Utilities -- Common Functions
*
- * Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
va_list args;
va_start(args, msg);
- fputs("lspci: ", stderr);
+ fprintf(stderr, "%s: ", program_name);
vfprintf(stderr, msg, args);
fputc('\n', stderr);
exit(1);
static int map_mode; /* Bus mapping mode enabled */
static int show_domains; /* Show domain numbers (0=disabled, 1=auto-detected, 2=requested) */
+const char program_name[] = "lspci";
+
static char options[] = "nvbxs:d:ti:mgMD" GENERIC_OPTIONS ;
static char help_msg[] = "\
#define PCIUTILS_VERSION PCILIB_VERSION
+extern const char program_name[];
+
void die(char *msg, ...) NONRET;
void *xmalloc(unsigned int howmuch);
void *xrealloc(void *ptr, unsigned int howmuch);
/*
* The PCI Utilities -- Manipulate PCI Configuration Registers
*
- * Copyright (c) 1998--2004 Martin Mares <mj@ucw.cz>
+ * Copyright (c) 1998--2006 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
static int verbose; /* Verbosity level */
static int demo_mode; /* Only show */
+const char program_name[] = "setpci";
+
static struct pci_access *pacc;
struct value {