summaryrefslogtreecommitdiffstats
path: root/sys-utils/tunelp.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:41 +0100
committerKarel Zak2006-12-07 00:25:41 +0100
commiteb63b9b8f4cecb34c2478282567862bc48ef256d (patch)
tree99243f8eecb44c2bb6a559982b99c680fcb649e7 /sys-utils/tunelp.c
parentImported from util-linux-2.9v tarball. (diff)
downloadkernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.tar.gz
kernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.tar.xz
kernel-qcow2-util-linux-eb63b9b8f4cecb34c2478282567862bc48ef256d.zip
Imported from util-linux-2.10f tarball.
Diffstat (limited to 'sys-utils/tunelp.c')
-rw-r--r--sys-utils/tunelp.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys-utils/tunelp.c b/sys-utils/tunelp.c
index dfb30aa67..7292a0cad 100644
--- a/sys-utils/tunelp.c
+++ b/sys-utils/tunelp.c
@@ -61,7 +61,6 @@
#include <errno.h>
#include "lp.h"
#include "nls.h"
-#include "../version.h"
struct command {
long op;
@@ -70,8 +69,6 @@ struct command {
};
-
-
void print_usage(char *progname) {
printf(_("Usage: %s <device> [ -i <IRQ> | -t <TIME> | -c <CHARS> | -w <WAIT> | \n"
" -a [on|off] | -o [on|off] | -C [on|off] | -q [on|off] | -s | \n"
@@ -95,12 +92,12 @@ void *mylloc(long size) {
return ptr;
}
-
+static char *progname;
long get_val(char *val) {
long ret;
if (!(sscanf(val, "%ld", &ret) == 1)) {
- perror(_("sscanf error"));
+ fprintf(stderr, _("%s: bad value\n"), progname);
exit(3);
}
return ret;
@@ -113,16 +110,20 @@ long get_onoff(char *val) {
return 0;
}
-
-
int main (int argc, char ** argv) {
int c, fd, irq, status, show_irq, offset = 0, retval;
- char *progname;
- char *filename;
+ char *filename, *p;
struct stat statbuf;
struct command *cmds, *cmdst;
progname = argv[0];
+ if ((p = strrchr(progname, '/')) != NULL)
+ progname = p+1;
+
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
if (argc < 2) print_usage(progname);
cmdst = cmds = mylloc(sizeof(struct command));