Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137178286
D8334.id21705.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D8334.id21705.diff
View Options
Index: head/contrib/elftoolchain/strings/strings.c
===================================================================
--- head/contrib/elftoolchain/strings/strings.c
+++ head/contrib/elftoolchain/strings/strings.c
@@ -48,12 +48,6 @@
ELFTC_VCSID("$Id: strings.c 3446 2016-05-03 01:31:17Z emaste $");
-enum return_code {
- RETURN_OK,
- RETURN_NOINPUT,
- RETURN_SOFTWARE
-};
-
enum radix_style {
RADIX_DECIMAL,
RADIX_HEX,
@@ -107,7 +101,7 @@
{
int ch, rc;
- rc = RETURN_OK;
+ rc = 0;
min_len = 0;
encoding_size = 1;
if (elf_version(EV_CURRENT) == EV_NONE)
@@ -197,7 +191,8 @@
if (!*argv)
rc = handle_file("{standard input}");
else while (*argv) {
- rc = handle_file(*argv);
+ if (handle_file(*argv) != 0)
+ rc = 1;
argv++;
}
return (rc);
@@ -209,11 +204,11 @@
int fd, rt;
if (name == NULL)
- return (RETURN_NOINPUT);
+ return (1);
if (strcmp("{standard input}", name) != 0) {
if (freopen(name, "rb", stdin) == NULL) {
warnx("'%s': %s", name, strerror(errno));
- return (RETURN_NOINPUT);
+ return (1);
}
} else {
return (find_strings(name, (off_t)0, (off_t)0));
@@ -221,7 +216,7 @@
fd = fileno(stdin);
if (fd < 0)
- return (RETURN_NOINPUT);
+ return (1);
rt = handle_elf(name, fd);
return (rt);
}
@@ -239,7 +234,7 @@
(void) lseek(fd, (off_t)0, SEEK_SET);
if (!fstat(fd, &buf))
return (find_strings(name, (off_t)0, buf.st_size));
- return (RETURN_SOFTWARE);
+ return (1);
}
/*
@@ -257,7 +252,7 @@
Elf_Scn *scn;
int rc;
- rc = RETURN_OK;
+ rc = 0;
/* If entire file is chosen, treat it as a binary file */
if (entire_file)
return (handle_binary(name, fd));
@@ -272,7 +267,7 @@
if (gelf_getehdr(elf, &elfhdr) == NULL) {
(void) elf_end(elf);
warnx("%s: ELF file could not be processed", name);
- return (RETURN_SOFTWARE);
+ return (1);
}
if (elfhdr.e_shnum == 0 && elfhdr.e_type == ET_CORE) {
@@ -352,7 +347,7 @@
if ((obuf = (char*)calloc(1, min_len + 1)) == NULL) {
(void) fprintf(stderr, "Unable to allocate memory: %s\n",
strerror(errno));
- return (RETURN_SOFTWARE);
+ return (1);
}
(void) fseeko(stdin, offset, SEEK_SET);
@@ -426,7 +421,7 @@
}
_exit1:
free(obuf);
- return (RETURN_OK);
+ return (0);
}
#define USAGE_MESSAGE "\
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 22, 9:31 AM (13 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25933631
Default Alt Text
D8334.id21705.diff (2 KB)
Attached To
Mode
D8334: strings: fix exit status if a file before the last one fails
Attached
Detach File
Event Timeline
Log In to Comment