Date: Wed, 3 May 2017 02:04:38 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317717 - stable/11/contrib/elftoolchain/strings Message-ID: <201705030204.v4324cqY092438@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Wed May 3 02:04:38 2017 New Revision: 317717 URL: https://svnweb.freebsd.org/changeset/base/317717 Log: MFC r312779: strings: avoid unnecessary trip through handle_file for stdin Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/elftoolchain/strings/strings.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/strings/strings.c ============================================================================== --- stable/11/contrib/elftoolchain/strings/strings.c Wed May 3 01:57:06 2017 (r317716) +++ stable/11/contrib/elftoolchain/strings/strings.c Wed May 3 02:04:38 2017 (r317717) @@ -189,7 +189,7 @@ main(int argc, char **argv) if (!min_len) min_len = 4; if (!*argv) - rc = handle_file("{standard input}"); + rc = find_strings("{standard input}", 0, 0); else while (*argv) { if (handle_file(*argv) != 0) rc = 1; @@ -205,13 +205,9 @@ handle_file(const char *name) if (name == NULL) return (1); - if (strcmp("{standard input}", name) != 0) { - if (freopen(name, "rb", stdin) == NULL) { - warnx("'%s': %s", name, strerror(errno)); - return (1); - } - } else { - return (find_strings(name, (off_t)0, (off_t)0)); + if (freopen(name, "rb", stdin) == NULL) { + warnx("'%s': %s", name, strerror(errno)); + return (1); } fd = fileno(stdin);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705030204.v4324cqY092438>