From owner-svn-src-all@freebsd.org Fri Sep 27 16:35:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 807DB1275F6; Fri, 27 Sep 2019 16:35:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fy7x2gJLz424w; Fri, 27 Sep 2019 16:35:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 273D41BAAB; Fri, 27 Sep 2019 16:35:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8RGZ9Ca049178; Fri, 27 Sep 2019 16:35:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGZ9iZ049177; Fri, 27 Sep 2019 16:35:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271635.x8RGZ9iZ049177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 16:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352799 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2019 16:35:09 -0000 Author: emaste Date: Fri Sep 27 16:35:08 2019 New Revision: 352799 URL: https://svnweb.freebsd.org/changeset/base/352799 Log: controlelf: clean up warnings - use explicit ELF note name when not found - no trailing . on warnings - no \n Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:32:44 2019 (r352798) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:35:08 2019 (r352799) @@ -132,9 +132,9 @@ main(int argc, char **argv) if ((kind = elf_kind(elf)) != ELF_K_ELF) { if (kind == ELF_K_AR) - warnx("file '%s' is an archive.", argv[0]); + warnx("file '%s' is an archive", argv[0]); else - warnx("file '%s' is not an ELF file.", + warnx("file '%s' is not an ELF file", argv[0]); retval = 1; goto fail; @@ -201,7 +201,7 @@ convert_to_feature_val(char* feature_str, u_int32_t* f else if (feature_str[0] == '=') set = true; else if (feature_str[0] != '-') { - warnx("'%c' is not an operator. Use instead '+', '-', '='.", + warnx("'%c' not an operator - use '+', '-', '='", feature_str[0]); return (false); } @@ -216,7 +216,7 @@ convert_to_feature_val(char* feature_str, u_int32_t* f } } if (i == len) { - warnx("%s is not a valid feature.", feature); + warnx("%s is not a valid feature", feature); return (false); } } @@ -238,7 +238,7 @@ edit_file_features(Elf *elf, int phcount, int fd, char u_int64_t off; if (!get_file_features(elf, phcount, fd, &features, &off)) { - warnx("No control features note on the file.\n"); + warnx("NT_FREEBSD_FEATURE_CTL note not found"); return (false); } @@ -327,7 +327,7 @@ get_file_features(Elf *elf, int phcount, int fd, u_int namesz = roundup2(note.n_namesz, 4); name = malloc(namesz); if (name == NULL) { - warn("malloc() failed.\n"); + warn("malloc() failed."); return (false); } descsz = roundup2(note.n_descsz, 4); @@ -339,7 +339,7 @@ get_file_features(Elf *elf, int phcount, int fd, u_int note.n_type != NT_FREEBSD_FEATURE_CTL) { /* Not the right note. Skip the description */ if (lseek(fd, descsz, SEEK_CUR) < 0) { - warn("lseek() failed.\n"); + warn("lseek() failed."); free(name); return (false); } @@ -360,7 +360,7 @@ get_file_features(Elf *elf, int phcount, int fd, u_int * descriptor. This should respect descsz. */ if (note.n_descsz > sizeof(u_int32_t)) - warnx("Feature note is bigger than expected."); + warnx("Feature note is bigger than expected"); read(fd, features, sizeof(u_int32_t)); if (off != NULL) *off = phdr.p_offset + read_total; @@ -369,6 +369,6 @@ get_file_features(Elf *elf, int phcount, int fd, u_int } } - warnx("Couldn't find a note header with control feature note."); + warnx("NT_FREEBSD_FEATURE_CTL note not found"); return (false); }