summaryrefslogtreecommitdiffstats
path: root/text-utils
diff options
context:
space:
mode:
authorSami Kerola2013-06-16 20:53:55 +0200
committerKarel Zak2013-07-01 11:08:01 +0200
commitf2a037fb7b153954d5d34cca48182b6d8832fcfa (patch)
tree19e468bafe375bb1097035053eca7f9ba7a7bfad /text-utils
parentsd-daemon: update files taken from systemd project (diff)
downloadkernel-qcow2-util-linux-f2a037fb7b153954d5d34cca48182b6d8832fcfa.tar.gz
kernel-qcow2-util-linux-f2a037fb7b153954d5d34cca48182b6d8832fcfa.tar.xz
kernel-qcow2-util-linux-f2a037fb7b153954d5d34cca48182b6d8832fcfa.zip
hexdump: remove unnecessary global variables
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils')
-rw-r--r--text-utils/display.c6
-rw-r--r--text-utils/hexdump.c4
-rw-r--r--text-utils/hexdump.h2
3 files changed, 5 insertions, 7 deletions
diff --git a/text-utils/display.c b/text-utils/display.c
index 1f9a11b4c..41ddd8db5 100644
--- a/text-utils/display.c
+++ b/text-utils/display.c
@@ -295,7 +295,7 @@ get(void)
int next(char **argv)
{
static int done;
- int statok;
+ int statok, exitval = 0;
if (argv) {
_argv = argv;
@@ -305,14 +305,14 @@ int next(char **argv)
if (*_argv) {
if (!(freopen(*_argv, "r", stdin))) {
warn("%s", *_argv);
- exitval = EXIT_FAILURE;
+ exitval = 1;
++_argv;
continue;
}
statok = done = 1;
} else {
if (done++)
- return(0);
+ return(exitval);
statok = 0;
}
if (skip)
diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c
index e966cc313..411d80986 100644
--- a/text-utils/hexdump.c
+++ b/text-utils/hexdump.c
@@ -47,11 +47,11 @@
FS *fshead; /* head of format strings */
ssize_t blocksize; /* data block size */
-int exitval; /* final exit value */
ssize_t length = -1; /* max bytes to read */
int main(int argc, char **argv)
{
+ int exitval; /* final exit value */
FS *tfs;
char *p;
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
for (tfs = fshead; tfs; tfs = tfs->nextfs)
rewrite(tfs);
- (void)next(argv);
+ exitval = next(argv);
display();
return exitval;
}
diff --git a/text-utils/hexdump.h b/text-utils/hexdump.h
index b9e67a1ba..b2ea1f152 100644
--- a/text-utils/hexdump.h
+++ b/text-utils/hexdump.h
@@ -73,8 +73,6 @@ typedef struct _fs { /* format strings */
extern FU *endfu;
extern FS *fshead; /* head of format strings list */
extern ssize_t blocksize; /* data block size */
-extern int deprecated; /* od compatibility */
-extern int exitval; /* final exit value */
extern ssize_t length; /* max bytes to read */
extern off_t skip; /* bytes to skip */