summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */