svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-12 Thread Ngie Cooper
Author: ngie
Date: Sat May 13 03:10:50 2017
New Revision: 318250
URL: https://svnweb.freebsd.org/changeset/base/318250

Log:
  Handle the logfiles in newsyslog and syslogd conditionally, based on
  src.conf(5) knobs
  
  This will allow consumers of FreeBSD to use the unmodified configuration
  files out of the box more than previously.
  
  Both newsyslog.conf and syslog.conf:
  - /var/log/lpd-errs (MK_LPR != no)
  - /var/log/ppp.log (MK_PPP != no)
  - /var/log/xferlog (MK_FTP != no)
  
  newsyslog.conf:
  - /var/log/amd.log (MK_AMD != no)
  - /var/log/pflog (MK_PF != no)
  - /var/log/sendmail.st (MK_SENDMAIL != no)
  
  MFC after:  3 weeks
  Sponsored by:   Dell EMC Isilon

Added:
  head/etc/newsyslog.conf.d/amd.conf   (contents, props changed)
  head/etc/newsyslog.conf.d/ftp.conf   (contents, props changed)
  head/etc/newsyslog.conf.d/lpr.conf   (contents, props changed)
  head/etc/newsyslog.conf.d/pf.conf   (contents, props changed)
  head/etc/newsyslog.conf.d/ppp.conf   (contents, props changed)
  head/etc/newsyslog.conf.d/sendmail.conf   (contents, props changed)
  head/etc/syslog.d/
  head/etc/syslog.d/Makefile   (contents, props changed)
  head/etc/syslog.d/ftp.conf   (contents, props changed)
  head/etc/syslog.d/lpr.conf   (contents, props changed)
  head/etc/syslog.d/ppp.conf   (contents, props changed)
Modified:
  head/etc/Makefile
  head/etc/newsyslog.conf
  head/etc/newsyslog.conf.d/Makefile
  head/etc/syslog.conf
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Fri May 12 18:37:08 2017(r318249)
+++ head/etc/Makefile   Sat May 13 03:10:50 2017(r318250)
@@ -8,7 +8,8 @@ FILESGROUPS=FILES
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
 SUBDIR=\
-   newsyslog.conf.d
+   newsyslog.conf.d \
+   syslog.d
 
 .if ${MK_SENDMAIL} != "no"
 SUBDIR+=sendmail

Modified: head/etc/newsyslog.conf
==
--- head/etc/newsyslog.conf Fri May 12 18:37:08 2017(r318249)
+++ head/etc/newsyslog.conf Sat May 13 03:10:50 2017(r318250)
@@ -18,7 +18,6 @@
 #
 # logfilename  [owner:group]mode count size when  flags 
[/pid_file] [sig_num]
 /var/log/all.log   600  7 *@T00  J
-/var/log/amd.log   644  7 1000 * J
 /var/log/auth.log  600  7 1000 @0101T JC
 /var/log/console.log   600  5 1000 * J
 /var/log/cron  600  3 1000 * JC
@@ -26,18 +25,13 @@
 /var/log/debug.log 600  7 1000 * JC
 /var/log/init.log  644  3 1000 * J
 /var/log/kerberos.log  600  7 1000 * J
-/var/log/lpd-errs  644  7 1000 * JC
 /var/log/maillog   640  7 *@T00  JC
 /var/log/messages  644  5 1000 @0101T JC
 /var/log/monthly.log   640  12*$M1D0 JN
-/var/log/pflog 600  3 1000 * JB
/var/run/pflogd.pid
-/var/log/ppp.log   root:network640  3 1000 * JC
 /var/log/devd.log  644  3 1000 * JC
 /var/log/security  600  101000 * JC
-/var/log/sendmail.st   640  10*168   BN
 /var/log/utx.log   644  3 *@01T05 B
 /var/log/weekly.log640  5 *$W6D0 JN
-/var/log/xferlog   600  7 1000 * JC
 
  /etc/newsyslog.conf.d/*
  /usr/local/etc/newsyslog.conf.d/*

Modified: head/etc/newsyslog.conf.d/Makefile
==
--- head/etc/newsyslog.conf.d/Makefile  Fri May 12 18:37:08 2017
(r318249)
+++ head/etc/newsyslog.conf.d/Makefile  Sat May 13 03:10:50 2017
(r318250)
@@ -6,8 +6,32 @@ BINDIR=/etc/newsyslog.conf.d
 
 FILES=
 
+.if ${MK_AMD} != "no"
+FILES+=amd.conf
+.endif
+
+.if ${MK_FTP} != "no"
+FILES+=ftp.conf
+.endif
+
+.if ${MK_LPR} != "no"
+FILES+=lpr.conf
+.endif
+
 .if ${MK_OFED} != "no"
 FILES+=opensm.conf
 .endif
 
+.if ${MK_PF} != "no"
+FILES+=pf.conf
+.endif
+
+.if ${MK_PPP} != "no"
+FILES+=ppp.conf
+.endif
+
+.if ${MK_SENDMAIL} != "no"
+FILES+=sendmail.conf
+.endif
+
 .include 

Added: head/etc/newsyslog.conf.d/amd.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/newsyslog.conf.d/amd.conf  Sat May 13 03:10:50 2017
(r318250)
@@ -0,0 +1,2 @@
+# $FreeBSD$
+/var/log/amd.log   64

Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Ngie Cooper
On May 13, 2017, at 08:37, Rodney W. Grimes  
wrote:

>> Author: ngie
>> Date: Sat May 13 03:10:50 2017
>> New Revision: 318250
>> URL: https://svnweb.freebsd.org/changeset/base/318250
>> 
>> Log:
>>  Handle the logfiles in newsyslog and syslogd conditionally, based on
>>  src.conf(5) knobs
>> 
>>  This will allow consumers of FreeBSD to use the unmodified configuration
>>  files out of the box more than previously.
> 
> What about simply generating proper newsyslog.conf and syslog.conf based
> on the the MK_ values rather than change the visible administration
> interface that has finger memory, ansible, and puppet support?

- My employer doesn't use puppet on its appliances.
- Files snapshotted in time bitrot (which was the case with our configs, which 
is part of the reason behind this change.
- It's really easy to screw up a mergemaster call if you edit the files, and 
install the stock version which removes the edits.
Thanks,
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318250 - in head: etc etc/newsyslog.conf.d etc/syslog.d tools/build/mk

2017-05-13 Thread Ngie Cooper

> On May 13, 2017, at 09:29, Ngie Cooper  wrote:
> 
> On May 13, 2017, at 08:37, Rodney W. Grimes  
> wrote:
> 
>>> Author: ngie
>>> Date: Sat May 13 03:10:50 2017
>>> New Revision: 318250
>>> URL: https://svnweb.freebsd.org/changeset/base/318250
>>> 
>>> Log:
>>> Handle the logfiles in newsyslog and syslogd conditionally, based on
>>> src.conf(5) knobs
>>> 
>>> This will allow consumers of FreeBSD to use the unmodified configuration
>>> files out of the box more than previously.
>> 
>> What about simply generating proper newsyslog.conf and syslog.conf based
>> on the the MK_ values rather than change the visible administration
>> interface that has finger memory, ansible, and puppet support?
> 
> - My employer doesn't use puppet on its appliances.
> - Files snapshotted in time bitrot (which was the case with our configs, 
> which is part of the reason behind this change.
> - It's really easy to screw up a mergemaster call if you edit the files, and 
> install the stock version which removes the edits.

Also, programmatically removing the entries means you have to bake the metadata 
into etc/Makefile, which is already complicated enough as-is.
Thanks,
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318255 - in head/sys: netinet netinet6

2017-05-13 Thread Ngie Cooper
Author: ngie
Date: Sat May 13 18:41:24 2017
New Revision: 318255
URL: https://svnweb.freebsd.org/changeset/base/318255

Log:
  Add missing braces around MCAST_EXCLUDE check when KTR support is
  compiled into the kernel
  
  This ensures that .iss_asm (the number of ASM listeners) isn't incorrectly
  decremented for MLD-layer source datagrams when inspecting im*s_st[1]
  (the second state in the structure).
  
  MFC after:2 months
  PR:   217509 [1]
  Reported by:  Coverity (Isilon)
  Reviewed by:  ae ("This patch looks correct to me." [1])
  Submitted by: Miles Ohlrich 
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/netinet/in_mcast.c
  head/sys/netinet6/in6_mcast.c

Modified: head/sys/netinet/in_mcast.c
==
--- head/sys/netinet/in_mcast.c Sat May 13 17:49:53 2017(r318254)
+++ head/sys/netinet/in_mcast.c Sat May 13 18:41:24 2017(r318255)
@@ -1047,9 +1047,10 @@ inm_merge(struct in_multi *inm, /*const*
/* Decrement ASM listener count on transition out of ASM mode. */
if (imf->imf_st[0] == MCAST_EXCLUDE && nsrc0 == 0) {
if ((imf->imf_st[1] != MCAST_EXCLUDE) ||
-   (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0))
+   (imf->imf_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) {
CTR1(KTR_IGMPV3, "%s: --asm on inm at t1", __func__);
--inm->inm_st[1].iss_asm;
+   }
}
 
/* Increment ASM listener count on transition to ASM mode. */

Modified: head/sys/netinet6/in6_mcast.c
==
--- head/sys/netinet6/in6_mcast.c   Sat May 13 17:49:53 2017
(r318254)
+++ head/sys/netinet6/in6_mcast.c   Sat May 13 18:41:24 2017
(r318255)
@@ -999,9 +999,10 @@ in6m_merge(struct in6_multi *inm, /*cons
/* Decrement ASM listener count on transition out of ASM mode. */
if (imf->im6f_st[0] == MCAST_EXCLUDE && nsrc0 == 0) {
if ((imf->im6f_st[1] != MCAST_EXCLUDE) ||
-   (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0))
+   (imf->im6f_st[1] == MCAST_EXCLUDE && nsrc1 > 0)) {
CTR1(KTR_MLD, "%s: --asm on inm at t1", __func__);
--inm->in6m_st[1].iss_asm;
+   }
}
 
/* Increment ASM listener count on transition to ASM mode. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318257 - head/usr.bin/localedef

2017-05-13 Thread Ngie Cooper
Author: ngie
Date: Sat May 13 19:59:03 2017
New Revision: 318257
URL: https://svnweb.freebsd.org/changeset/base/318257

Log:
  style(9): sort headers
  
  MFC after:3 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/localedef/localedef.h

Modified: head/usr.bin/localedef/localedef.h
==
--- head/usr.bin/localedef/localedef.h  Sat May 13 18:59:27 2017
(r318256)
+++ head/usr.bin/localedef/localedef.h  Sat May 13 19:59:03 2017
(r318257)
@@ -35,10 +35,10 @@
  */
 
 /* Common header files. */
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
 
 extern int com_char;
 extern int esc_char;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318278 - head/usr.bin/localedef

2017-05-14 Thread Ngie Cooper
Author: ngie
Date: Sun May 14 18:47:09 2017
New Revision: 318278
URL: https://svnweb.freebsd.org/changeset/base/318278

Log:
  Mark errf _Noreturn, and mark errf and warn __printflike
  
  The _Noreturn attribute was added to placate Coverity and other static
  analysis tools. The __printflike attribute was added to catch issues
  with the calls related to printf(3) abuse.
  
  - Modify the code to facilitate the __printflike attribute addition.
  - Convert errf calls in to_mb(..) and to_mb_string(..) to warn(..) so
the calls will return instead of exiting, as the code suggests it
should.
  
  Differential Revision:D10704
  MFC after:1 month
  Reviewed by:  pfg
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/localedef/localedef.c
  head/usr.bin/localedef/localedef.h
  head/usr.bin/localedef/wide.c

Modified: head/usr.bin/localedef/localedef.c
==
--- head/usr.bin/localedef/localedef.c  Sun May 14 17:10:55 2017
(r318277)
+++ head/usr.bin/localedef/localedef.c  Sun May 14 18:47:09 2017
(r318278)
@@ -119,7 +119,7 @@ open_category(void)
 */
file = fopen(category_file(), "w");
if (file == NULL) {
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (NULL);
}
return (file);
@@ -131,11 +131,11 @@ close_category(FILE *f)
if (fchmod(fileno(f), 0644) < 0) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
}
if (fclose(f) < 0) {
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
}
if (verbose) {
(void) fprintf(stdout, "done.\n");
@@ -195,13 +195,13 @@ putl_category(const char *s, FILE *f)
if (s && fputs(s, f) == EOF) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (EOF);
}
if (fputc('\n', f) == EOF) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (EOF);
}
return (0);
@@ -216,7 +216,7 @@ wr_category(void *buf, size_t sz, FILE *
if (fwrite(buf, sz, 1, f) < 1) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (EOF);
}
return (0);
@@ -331,7 +331,7 @@ main(int argc, char **argv)
while ((dir = opendir(locname)) == NULL) {
if ((errno != ENOENT) ||
(mkdir(locname, 0755) <  0)) {
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
}
}
(void) closedir(dir);

Modified: head/usr.bin/localedef/localedef.h
==
--- head/usr.bin/localedef/localedef.h  Sun May 14 17:10:55 2017
(r318277)
+++ head/usr.bin/localedef/localedef.h  Sun May 14 18:47:09 2017
(r318278)
@@ -35,6 +35,7 @@
  */
 
 /* Common header files. */
+#include 
 #include 
 #include 
 #include 
@@ -54,8 +55,8 @@ extern int warnings;
 
 int yylex(void);
 void yyerror(const char *);
-void errf(const char *, ...);
-void warn(const char *, ...);
+_Noreturn void errf(const char *, ...) __printflike(1, 2);
+void warn(const char *, ...) __printflike(1, 2);
 
 int putl_category(const char *, FILE *);
 int wr_category(void *, size_t, FILE *);

Modified: head/usr.bin/localedef/wide.c
==
--- head/usr.bin/localedef/wide.c   Sun May 14 17:10:55 2017
(r318277)
+++ head/usr.bin/localedef/wide.c   Sun May 14 18:47:09 2017
(r318278)
@@ -598,7 +598,7 @@ to_mb(char *mb, wchar_t wc)
int rv;
 
if ((rv = _tomb(mb, wc)) < 0) {
-   errf(widemsg);
+   warn("%s", widemsg);
free(widemsg);
widemsg = NULL;
}
@@ -614,7 +614,7 @@ to_mb_string(const wchar_t *wcs)
 
mbs = malloc((wcslen(wcs) * mb_cur_max) + 1);
if (mbs == NULL) {
-   errf("out of memory");
+   warn("out of memory");
return (NULL);
}
ptr = mbs;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318280 - head/usr.bin/getconf

2017-05-14 Thread Ngie Cooper
Author: ngie
Date: Sun May 14 20:39:01 2017
New Revision: 318280
URL: https://svnweb.freebsd.org/changeset/base/318280

Log:
  getconf: use nitems(..) to compute NWORDS instead of hardcoding
  the equivalent macro
  
  MFC after:1 month
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/getconf/fake-gperf.awk

Modified: head/usr.bin/getconf/fake-gperf.awk
==
--- head/usr.bin/getconf/fake-gperf.awk Sun May 14 20:17:50 2017
(r318279)
+++ head/usr.bin/getconf/fake-gperf.awk Sun May 14 20:39:01 2017
(r318280)
@@ -36,7 +36,8 @@ state == 1 { print; next; }
   state = 3;
   print "\t{ NULL, 0, 0 }";
   print "};";
-  print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)";
+  print "#include ";
+  print "#define\tNWORDS\t(nitems(wordlist) - 1)";
   print "static const struct map *";
   print "in_word_set(const char *word)";
   print "{";
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318315 - head/contrib/netbsd-tests/lib/libc/gen

2017-05-15 Thread Ngie Cooper
Author: ngie
Date: Mon May 15 19:58:01 2017
New Revision: 318315
URL: https://svnweb.freebsd.org/changeset/base/318315

Log:
  lib/libc/gen/realpath_test: make check result from getcwd(3)
  
  This is being done to avoid dereferencing a NULL pointer via strlcat,
  obscuring the underlying issue with the getcwd(3) call.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c
==
--- head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c Mon May 15 19:32:26 
2017(r318314)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_realpath.c Mon May 15 19:58:01 
2017(r318315)
@@ -34,6 +34,9 @@ __RCSID("$NetBSD: t_realpath.c,v 1.2 201
 #include 
 
 #include 
+#ifdef __FreeBSD__
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -122,8 +125,15 @@ ATF_TC_BODY(realpath_symlink, tc)
char resb[MAXPATHLEN] = { 0 };
int fd;
 
+#ifdef __FreeBSD__
+   ATF_REQUIRE_MSG(getcwd(path, sizeof(path)) != NULL,
+   "getcwd(path) failed: %s", strerror(errno));
+   ATF_REQUIRE_MSG(getcwd(slnk, sizeof(slnk)) != NULL,
+   "getcwd(slnk) failed: %s", strerror(errno));
+#else
(void)getcwd(path, sizeof(path));
(void)getcwd(slnk, sizeof(slnk));
+#endif
 
(void)strlcat(path, "/realpath", sizeof(path));
(void)strlcat(slnk, "/symbolic", sizeof(slnk));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318325 - in head: etc/mtree usr.bin/procstat usr.bin/procstat/tests

2017-05-15 Thread Ngie Cooper
Author: ngie
Date: Mon May 15 22:52:25 2017
New Revision: 318325
URL: https://svnweb.freebsd.org/changeset/base/318325

Log:
  Start writing up some basic feature tests for procstat
  
  These tests query a running process for information related to the -b,
  -c, -e, and -f flags; the -f testcase is largely stubbed out, pending
  additional work to determine a good, deterministic descriptor.
  
  Core file test support is coming soon--it requires a bit more effort
  due to the fact that:
  - coredumps can be disabled (kern.coredump=0).
  - corefiles can be put in different directories than the current
directory, or be named something other than `.core`
(`kern.corefile`).
  
  MFC after:2 months
  Sponsored by: Dell EMC Isilon

Added:
  head/usr.bin/procstat/tests/
  head/usr.bin/procstat/tests/Makefile   (contents, props changed)
  head/usr.bin/procstat/tests/procstat_test.sh   (contents, props changed)
  head/usr.bin/procstat/tests/while1.c   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.bin/procstat/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Mon May 15 22:51:22 2017
(r318324)
+++ head/etc/mtree/BSD.tests.dist   Mon May 15 22:52:25 2017
(r318325)
@@ -650,6 +650,8 @@
 ..
 printf
 ..
+procstat
+..
 sdiff
 ..
 sed

Modified: head/usr.bin/procstat/Makefile
==
--- head/usr.bin/procstat/Makefile  Mon May 15 22:51:22 2017
(r318324)
+++ head/usr.bin/procstat/Makefile  Mon May 15 22:52:25 2017
(r318325)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 PROG=  procstat
 MAN=   procstat.1
 SRCS=  procstat.c  \
@@ -20,4 +22,8 @@ SRCS= procstat.c  \
 
 LIBADD+=   procstat xo util sbuf
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=   tests
+.endif
+
 .include 

Added: head/usr.bin/procstat/tests/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/procstat/tests/MakefileMon May 15 22:52:25 2017
(r318325)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+ATF_TESTS_SH+= procstat_test
+
+PROGS+=while1
+
+BINDIR=${TESTSDIR}
+
+.include 

Added: head/usr.bin/procstat/tests/procstat_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/procstat/tests/procstat_test.shMon May 15 22:52:25 
2017(r318325)
@@ -0,0 +1,140 @@
+#
+# Copyright (c) 2017 Ngie Cooper 
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+MAX_TRIES=20
+PROG_PID=
+PROG_PATH=$(atf_get_srcdir)/while1
+
+SP='[[:space:]]'
+
+start_program()
+{
+   echo "Starting program in background"
+   PROG_COMM=while1
+   PROG_PATH=$(atf_get_srcdir)/$PROG_COMM
+
+   $PROG_PATH $* &
+   PROG_PID=$!
+   try=0
+   while [ $try -lt $MAX_TRIES ] && ! kill -0 $PROG_PID; do
+   sleep 0.5
+   : $(( try += 1 ))
+   done
+   if [ $try -ge $MAX_TRIES ]; then
+   atf_fail "Polled for program start $MAX_TRIES tries and failed"
+   fi
+}
+
+atf_test_case binary_info
+binary_info_head()
+{
+   atf_set "descr" "Checks -b support"
+}
+binary_info_body()
+{
+   start_program bogus-arg
+
+   line_fo

svn commit: r318434 - head/usr.bin/getconf

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 01:35:07 2017
New Revision: 318434
URL: https://svnweb.freebsd.org/changeset/base/318434

Log:
  Make the `.gperf.c` suffix rule depend on fake-gperf.awk
  
  Parameterize out fake-gperf.awk to avoid duplicating the path
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/getconf/Makefile

Modified: head/usr.bin/getconf/Makefile
==
--- head/usr.bin/getconf/Makefile   Thu May 18 01:32:50 2017
(r318433)
+++ head/usr.bin/getconf/Makefile   Thu May 18 01:35:07 2017
(r318434)
@@ -13,8 +13,9 @@ CLEANFILES+=  confstr.c limits.c pathconf
 
 all:   conflicts
 
-.gperf.c:
-   LC_ALL=C awk -f ${.CURDIR}/fake-gperf.awk ${.IMPSRC} >${.TARGET}
+FAKE_GPERF=${.CURDIR}/fake-gperf.awk
+.gperf.c: ${FAKE_GPERF}
+   LC_ALL=C awk -f ${FAKE_GPERF} ${.IMPSRC} >${.TARGET}
 
 .gperf.names:
LC_ALL=C awk '/^[_A-Z]/ { print; }' ${.IMPSRC} | \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318436 - in head: etc/mtree usr.bin/getconf usr.bin/getconf/tests

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 01:43:30 2017
New Revision: 318436
URL: https://svnweb.freebsd.org/changeset/base/318436

Log:
  usr.bin/getconf: add some initial tests
  
  Items tested via this commit are:
  - Some basic POSIX constants.
  - Some valid programming environments with -v.
  - Some invalid programming environments via -v.
  
  NOTE: this test makes assumptions about ILP32/LP32 vs LP64 that are
  currently not true on all architectures to avoid hardcoding some
  architectures in the tests. I'm working on improving getconf(1) to be
  more sane about handling ILP32/LP32 vs LP64. Future commits are coming
  soon to address this.
  
  MFC after:2 weeks
  Tested with:  amd64, i386
  Sponsored by: Dell EMC Isilon

Added:
  head/usr.bin/getconf/tests/
  head/usr.bin/getconf/tests/Makefile   (contents, props changed)
  head/usr.bin/getconf/tests/arch_type.c   (contents, props changed)
  head/usr.bin/getconf/tests/getconf_test.sh   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.bin/getconf/Makefile
  head/usr.bin/getconf/getconf.h

Modified: head/etc/mtree/BSD.tests.dist
==
--- head/etc/mtree/BSD.tests.dist   Thu May 18 01:42:55 2017
(r318435)
+++ head/etc/mtree/BSD.tests.dist   Thu May 18 01:43:30 2017
(r318436)
@@ -622,6 +622,8 @@
 ..
 file2c
 ..
+getconf
+..
 grep
 ..
 gzip

Modified: head/usr.bin/getconf/Makefile
==
--- head/usr.bin/getconf/Makefile   Thu May 18 01:42:55 2017
(r318435)
+++ head/usr.bin/getconf/Makefile   Thu May 18 01:43:30 2017
(r318436)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 PROG=  getconf
 
 SRCS=  confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c
@@ -35,4 +37,8 @@ conflicting.names:confstr.names limits.
 unique.names:  conflicting.names
LC_ALL=C sort -u ${.ALLSRC} >${.TARGET}
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=   tests
+.endif
+
 .include 

Modified: head/usr.bin/getconf/getconf.h
==
--- head/usr.bin/getconf/getconf.h  Thu May 18 01:42:55 2017
(r318435)
+++ head/usr.bin/getconf/getconf.h  Thu May 18 01:43:30 2017
(r318436)
@@ -36,8 +36,15 @@ typedef long long intmax_t;
 #include 
 #endif
 
+typedef enum {
+   PROG_ENV_VALID_NO_ALT_PATH = -1,
+   PROG_ENV_INVALID = 0,
+   PROG_ENV_VALID_HAS_ALT_PATH = 1,
+   PROG_ENV_UNKNOWN = 2,
+} prog_env_validity;
+
 intfind_confstr(const char *name, int *key);
 intfind_limit(const char *name, intmax_t *value);
 intfind_pathconf(const char *name, int *key);
-intfind_progenv(const char *name, const char **alt_path);
+prog_env_validity  find_progenv(const char *name, const char **alt_path);
 intfind_sysconf(const char *name, int *key);

Added: head/usr.bin/getconf/tests/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/getconf/tests/Makefile Thu May 18 01:43:30 2017
(r318436)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+ATF_TESTS_SH+= getconf_test
+
+PROGS+=arch_type
+
+BINDIR=${TESTSDIR}
+
+WARNS?=6
+
+.include 

Added: head/usr.bin/getconf/tests/arch_type.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/getconf/tests/arch_type.c  Thu May 18 01:43:30 2017
(r318436)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2017 Ngie Cooper 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABIL

svn commit: r318437 - head/usr.bin/getconf

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 01:46:30 2017
New Revision: 318437
URL: https://svnweb.freebsd.org/changeset/base/318437

Log:
  Revert local changes to find_progenv accidentally committed in r318436
  
  MFC after:2 weeks
  MFC with: r318436
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/getconf/getconf.h

Modified: head/usr.bin/getconf/getconf.h
==
--- head/usr.bin/getconf/getconf.h  Thu May 18 01:43:30 2017
(r318436)
+++ head/usr.bin/getconf/getconf.h  Thu May 18 01:46:30 2017
(r318437)
@@ -36,15 +36,8 @@ typedef long long intmax_t;
 #include 
 #endif
 
-typedef enum {
-   PROG_ENV_VALID_NO_ALT_PATH = -1,
-   PROG_ENV_INVALID = 0,
-   PROG_ENV_VALID_HAS_ALT_PATH = 1,
-   PROG_ENV_UNKNOWN = 2,
-} prog_env_validity;
-
 intfind_confstr(const char *name, int *key);
 intfind_limit(const char *name, intmax_t *value);
 intfind_pathconf(const char *name, int *key);
-prog_env_validity  find_progenv(const char *name, const char **alt_path);
+intfind_progenv(const char *name, const char **alt_path);
 intfind_sysconf(const char *name, int *key);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318439 - head/sys/modules/ipsec

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:13:29 2017
New Revision: 318439
URL: https://svnweb.freebsd.org/changeset/base/318439

Log:
  Normalize .PATH on SRCTOP
  
  This will help Jenkins dedupe 9 warnings between the static build and
  the module build of ipsec(4).
  
  Missed in SRCTOP conversion in r314651.
  
  MFC with: r314651
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/modules/ipsec/Makefile

Modified: head/sys/modules/ipsec/Makefile
==
--- head/sys/modules/ipsec/Makefile Thu May 18 03:32:01 2017
(r318438)
+++ head/sys/modules/ipsec/Makefile Thu May 18 06:13:29 2017
(r318439)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-.PATH: ${SRCTOP}/sys/net ${.CURDIR}/../../netipsec
+.PATH: ${SRCTOP}/sys/net ${SRCTOP}/sys/netipsec
 
 KMOD=  ipsec
 SRCS=  if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_mod.c \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318440 - head/sys/modules/dtrace/dtaudit

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:15:42 2017
New Revision: 318440
URL: https://svnweb.freebsd.org/changeset/base/318440

Log:
  Normalize SYSDIR on SRCTOP instead of .CURDIR
  
  This is being done to simplify pathing for CFLAGS and source files.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/modules/dtrace/dtaudit/Makefile

Modified: head/sys/modules/dtrace/dtaudit/Makefile
==
--- head/sys/modules/dtrace/dtaudit/MakefileThu May 18 06:13:29 2017
(r318439)
+++ head/sys/modules/dtrace/dtaudit/MakefileThu May 18 06:15:42 2017
(r318440)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-SYSDIR?=   ${.CURDIR}/../../..
+SYSDIR?=   ${SRCTOP}/sys
 
 .PATH: ${SYSDIR}/security/audit
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318441 - in head/etc: . cron.d

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:25:39 2017
New Revision: 318441
URL: https://svnweb.freebsd.org/changeset/base/318441

Log:
  Handle the cron.d entry for MK_AT in cron conditionally
  
  Install /etc/cron.d/at if MK_AT != no, always using it, which tries
  to run a non-existent program via cron(8) every 5 minutes with the
  default /etc/crontab, prior to this commit.
  
  SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
  because atrun(8) executes programs, which may rely on environment
  currently set via /etc/crontab.
  
  Noted by: bdrewery (in an internal review)
  MFC after:2 months
  Relnotes: yes (may need to add environmental modifications to
 /etc/cron.d/at)
  Sponsored by: Dell EMC Isilon

Added:
  head/etc/cron.d/
  head/etc/cron.d/Makefile   (contents, props changed)
  head/etc/cron.d/at   (contents, props changed)
Modified:
  head/etc/Makefile
  head/etc/crontab

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 18 06:15:42 2017(r318440)
+++ head/etc/Makefile   Thu May 18 06:25:39 2017(r318441)
@@ -8,6 +8,7 @@ FILESGROUPS=FILES
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
 SUBDIR=\
+   cron.d \
newsyslog.conf.d \
syslog.d
 

Added: head/etc/cron.d/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/MakefileThu May 18 06:25:39 2017(r318441)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+.include 
+
+.if ${MK_AT} != "no"
+FILES+=at
+.endif
+
+BINDIR=/etc/cron.d
+
+.include 

Added: head/etc/cron.d/at
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/at  Thu May 18 06:25:39 2017(r318441)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+#
+SHELL=/bin/sh
+PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
+
+# See crontab(5) for field format.
+*/5*   *   *   *   root/usr/libexec/atrun

Modified: head/etc/crontab
==
--- head/etc/crontabThu May 18 06:15:42 2017(r318440)
+++ head/etc/crontabThu May 18 06:25:39 2017(r318441)
@@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 #
 #minutehourmdaymonth   wdaywho command
 #
-*/5*   *   *   *   root/usr/libexec/atrun
-#
 # Save some entropy so that /dev/random can re-seed on boot.
 */11   *   *   *   *   operator /usr/libexec/save-entropy
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318442 - in head/etc: . cron.d

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:27:37 2017
New Revision: 318442
URL: https://svnweb.freebsd.org/changeset/base/318442

Log:
  Revert r318441: the commit message was incoherent

Deleted:
  head/etc/cron.d/
Modified:
  head/etc/Makefile
  head/etc/crontab

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 18 06:25:39 2017(r318441)
+++ head/etc/Makefile   Thu May 18 06:27:37 2017(r318442)
@@ -8,7 +8,6 @@ FILESGROUPS=FILES
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
 SUBDIR=\
-   cron.d \
newsyslog.conf.d \
syslog.d
 

Modified: head/etc/crontab
==
--- head/etc/crontabThu May 18 06:25:39 2017(r318441)
+++ head/etc/crontabThu May 18 06:27:37 2017(r318442)
@@ -7,6 +7,8 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 #
 #minutehourmdaymonth   wdaywho command
 #
+*/5*   *   *   *   root/usr/libexec/atrun
+#
 # Save some entropy so that /dev/random can re-seed on boot.
 */11   *   *   *   *   operator /usr/libexec/save-entropy
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318443 - in head/etc: . cron.d

2017-05-17 Thread Ngie Cooper
Author: ngie
Date: Thu May 18 06:33:55 2017
New Revision: 318443
URL: https://svnweb.freebsd.org/changeset/base/318443

Log:
  Conditionally handle the crontab entry for atrun(8)
  
  The default crontab prior to this commit assumes atrun(8) is always
  present, which isn't true if MK_AT == no. Move atrun(8) execution
  from /etc/crontab to /etc/cron.d/at, and base /etc/cron.d/at's installation
  on MK_AT. cron(8) will detect /etc/cron.d/at's presence when the configuration
  is loaded and run atrun every 5 minutes like it would prior to this commit.
  
  SHELL and PATH are duplicated between /etc/crontab and /etc/cron.d/at
  because atrun(8) executes programs, which may rely on environment
  set in the current default /etc/crontab.
  
  Noted by: bdrewery (in an internal review)
  MFC after:2 months
  Relnotes: yes (may need to add environmental modifications to
 /etc/cron.d/at)
  Sponsored by: Dell EMC Isilon

Added:
  head/etc/cron.d/
  head/etc/cron.d/Makefile   (contents, props changed)
  head/etc/cron.d/at   (contents, props changed)
Modified:
  head/etc/Makefile
  head/etc/crontab

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Thu May 18 06:27:37 2017(r318442)
+++ head/etc/Makefile   Thu May 18 06:33:55 2017(r318443)
@@ -8,6 +8,7 @@ FILESGROUPS=FILES
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
 SUBDIR=\
+   cron.d \
newsyslog.conf.d \
syslog.d
 

Added: head/etc/cron.d/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/MakefileThu May 18 06:33:55 2017(r318443)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+.include 
+
+.if ${MK_AT} != "no"
+FILES+=at
+.endif
+
+BINDIR=/etc/cron.d
+
+.include 

Added: head/etc/cron.d/at
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/cron.d/at  Thu May 18 06:33:55 2017(r318443)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+#
+SHELL=/bin/sh
+PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
+
+# See crontab(5) for field format.
+*/5*   *   *   *   root/usr/libexec/atrun

Modified: head/etc/crontab
==
--- head/etc/crontabThu May 18 06:27:37 2017(r318442)
+++ head/etc/crontabThu May 18 06:33:55 2017(r318443)
@@ -7,8 +7,6 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
 #
 #minutehourmdaymonth   wdaywho command
 #
-*/5*   *   *   *   root/usr/libexec/atrun
-#
 # Save some entropy so that /dev/random can re-seed on boot.
 */11   *   *   *   *   operator /usr/libexec/save-entropy
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318545 - head/etc

2017-05-19 Thread Ngie Cooper
Author: ngie
Date: Fri May 19 17:04:01 2017
New Revision: 318545
URL: https://svnweb.freebsd.org/changeset/base/318545

Log:
  Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make 
install`
  
  I incorrectly started this pattern in r277541 with the opensm 
newsyslog.conf.d file,
  and continued using it in r318441 and r318443.
  
  This will fix the files being handled improperly via installworld, preventing 
tools like
  etcupdate, mergemaster, etc from functioning properly when comparing the 
installed
  contents on a system vs the contents in a source tree when doing merges.
  
  PR:   219404
  Submitted by: Dan McGregor 
  MFC after:2 weeks
  MFC with: r277541, r318441, r318443
  Sponsored by: Dell EMC Isilon

Modified:
  head/etc/Makefile

Modified: head/etc/Makefile
==
--- head/etc/Makefile   Fri May 19 16:22:26 2017(r318544)
+++ head/etc/Makefile   Fri May 19 17:04:01 2017(r318545)
@@ -7,10 +7,6 @@ FILESGROUPS=   FILES
 
 # No need as it is empty and just causes rebuilds since this file does so much.
 UPDATE_DEPENDFILE= no
-SUBDIR=\
-   cron.d \
-   newsyslog.conf.d \
-   syslog.d
 
 .if ${MK_SENDMAIL} != "no"
 SUBDIR+=sendmail
@@ -254,9 +250,11 @@ distribution:
 .if ${MK_CASPER} != "no"
${_+_}cd ${.CURDIR}/casper; ${MAKE} install
 .endif
+   ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install
${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
${_+_}cd ${.CURDIR}/devd; ${MAKE} install
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
+   ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
 .if ${MK_NTP} != "no"
${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
 .endif
@@ -266,6 +264,7 @@ distribution:
 .endif
${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
+   ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318546 - in head: contrib/netbsd-tests/fs/tmpfs tests/sys/fs/tmpfs

2017-05-19 Thread Ngie Cooper
Author: ngie
Date: Fri May 19 17:14:29 2017
New Revision: 318546
URL: https://svnweb.freebsd.org/changeset/base/318546

Log:
  sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic
  
  The previous logic was flawed in the sense that it assumed that /dev/md3
  was always available. This was a caveat I noted in r306038, that I hadn't
  gotten around to solving before now.
  
  Cache the device for the mountpoint after executing mdmfs, then use the
  cached value in basic_cleanup(..) when unmounting/disconnecting the md(4)
  device.
  
  Apply sed expressions to use reuse logic in the NetBSD code that could
  also be applied to FreeBSD, just with different tools.
  
  Differential Revision:D10766
  MFC after:1 week
  Reviewed by:  bdrewery
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
  head/tests/sys/fs/tmpfs/Makefile

Modified: head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh
==
--- head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri May 19 17:04:01 2017
(r318545)
+++ head/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh Fri May 19 17:14:29 2017
(r318546)
@@ -28,6 +28,10 @@
 # Verifies that vnd works with files stored in tmpfs.
 #
 
+# Begin FreeBSD
+MD_DEVICE_FILE=md.device
+# End FreeBSD
+
 atf_test_case basic cleanup
 basic_head() {
atf_set "descr" "Verifies that vnd works with files stored in tmpfs"
@@ -41,7 +45,10 @@ basic_body() {
# Begin FreeBSD
if true; then
atf_check -s eq:0 -o empty -e empty mkdir mnt
-   atf_check -s eq:0 -o empty -e empty mdmfs -F disk.img md3 mnt
+   atf_check -s eq:0 -o empty -e empty mdmfs -F disk.img md mnt
+   md_dev=$(df mnt | awk 'NR != 1 { print $1 }' | xargs basename)
+   atf_check test -c /dev/$md_dev # Sanity check
+   echo -n $md_dev > $TMPDIR/$MD_DEVICE_FILE
else
# End FreeBSD
atf_check -s eq:0 -o empty -e empty vndconfig /dev/vnd3 disk.img
@@ -67,31 +74,23 @@ basic_body() {
done
 
atf_check -s eq:0 -o empty -e empty umount mnt
-   # Begin FreeBSD
-   if true; then
-   atf_check -s eq:0 -o empty -e empty mdconfig -d -u 3
-   else
-   # End FreeBSD
atf_check -s eq:0 -o empty -e empty vndconfig -u /dev/vnd3
-   # Begin FreeBSD
-   fi
-   # End FreeBSD
 
test_unmount
touch done
 }
 basic_cleanup() {
+   # Begin FreeBSD
+   if md_dev=$(cat $TMPDIR/$MD_DEVICE_FILE); then
+   echo "Will try disconnecting $md_dev"
+   else
+   echo "$MD_DEVICE_FILE doesn't exist in $TMPDIR; returning early"
+   return 0
+   fi
+   # End FreeBSD
if [ ! -f done ]; then
umount mnt 2>/dev/null 1>&2
-   # Begin FreeBSD
-   if true; then
-   [ ! -c /dev/md3 ] || mdconfig -d -u 3
-   else
-   # End FreeBSD
vndconfig -u /dev/vnd3 2>/dev/null 1>&2
-   # Begin FreeBSD
-   fi
-   # End FreeBSD
fi
 }
 

Modified: head/tests/sys/fs/tmpfs/Makefile
==
--- head/tests/sys/fs/tmpfs/MakefileFri May 19 17:04:01 2017
(r318545)
+++ head/tests/sys/fs/tmpfs/MakefileFri May 19 17:14:29 2017
(r318546)
@@ -54,6 +54,9 @@ ATF_TESTS_SH_SED_mount_test=  \
 ATF_TESTS_SH_SED_readdir_test= -e 's,mknod fifo p,mkfifo fifo,g'
 ATF_TESTS_SH_SED_sizes_test=   -e 's,-o -s,-o size=,g'
 ATF_TESTS_SH_SED_statvfs_test= -e 's,-o -s,-o size=,g'
+ATF_TESTS_SH_SED_vnd_test= \
+   -e 's,vndconfig -u /dev/vnd3,mdconfig 
-d -u $$md_dev,g' \
+   -e 's,/dev/vnd3,/dev/$$md_dev,g'
 ATF_TESTS_SH_SED_vnode_leak_test=  -e 's,-o -s,-o size=,g'
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318651 - head/sys

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Mon May 22 15:53:30 2017
New Revision: 318651
URL: https://svnweb.freebsd.org/changeset/base/318651

Log:
  Remove glimpse make target added in r181432
  
  The textproc/glimpse port expired over 3 years ago because there weren't any
  more publicly available distfiles, and because it lacked a maintainer. Remove
  the target as it's no longer executable on FreeBSD.
  
  Differential Revision:D10764
  MFC after:1 month
  Reviewed by:  imp
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/Makefile

Modified: head/sys/Makefile
==
--- head/sys/Makefile   Mon May 22 15:51:17 2017(r318650)
+++ head/sys/Makefile   Mon May 22 15:53:30 2017(r318651)
@@ -59,19 +59,7 @@ TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.
rm -f ${.CURDIR}/TAGS
cd ${.CURDIR}; xargs etags -a < ${.CURDIR}/cscope.files
 
-# You need the textproc/glimpse ports for this.
-glimpse:
-.if !exists(${.CURDIR}/.glimpse_exclude)
-   echo .svn > ${.CURDIR}/.glimpse_exclude
-   echo /compile/ >> ${.CURDIR}/.glimpse_exclude
-.endif
-   cd ${.CURDIR}; glimpseindex -H . -B -f -o .
-
-glimpse-clean:
-   cd ${.CURDIR}; rm -f .glimpse_*
-
-.if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS) || 
\
-make(glimpse) || make(glimpse-clean))
+.if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS))
 .include 
 
 # The boot loader
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318693 - head/usr.sbin/bsdinstall/partedit

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 06:04:38 2017
New Revision: 318693
URL: https://svnweb.freebsd.org/changeset/base/318693

Log:
  Some minor style(9) fixes
  
  - Wrap at <80 columns.
  - Sort by type
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/bsdinstall/partedit/part_wizard.c

Modified: head/usr.sbin/bsdinstall/partedit/part_wizard.c
==
--- head/usr.sbin/bsdinstall/partedit/part_wizard.c Tue May 23 04:14:34 
2017(r318692)
+++ head/usr.sbin/bsdinstall/partedit/part_wizard.c Tue May 23 06:04:38 
2017(r318693)
@@ -47,11 +47,12 @@ static char *boot_disk(struct gmesh *mes
 static char *wizard_partition(struct gmesh *mesh, const char *disk);
 
 int
-part_wizard(const char *fsreq) {
-   int error;
-   struct gmesh mesh;
+part_wizard(const char *fsreq)
+{
char *disk, *schemeroot;
const char *fstype;
+   struct gmesh mesh;
+   int error;
 
if (fsreq != NULL)
fstype = fsreq;
@@ -199,9 +200,9 @@ wizard_partition(struct gmesh *mesh, con
struct gclass *classp;
struct ggeom *gpart = NULL;
struct gconfig *gc;
-   char message[512];
-   const char *scheme = NULL;
char *retval = NULL;
+   const char *scheme = NULL;
+   char message[512];
int choice;
 
LIST_FOREACH(classp, &mesh->lg_class, lg_class)
@@ -295,15 +296,17 @@ query:
 }
 
 int
-wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, int 
interactive)
+wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype,
+int interactive)
 {
-   struct gmesh submesh;
struct gclass *classp;
struct ggeom *gp;
struct gprovider *pp;
-   intmax_t swapsize, available;
-   char swapsizestr[10], rootsizestr[10], *fsname;
char *fsnames[] = {"freebsd-ufs", "freebsd-zfs"};
+   char *fsname;
+   struct gmesh submesh;
+   char swapsizestr[10], rootsizestr[10];
+   intmax_t swapsize, available;
int retval;
 
if (strcmp(fstype, "zfs") == 0) {
@@ -362,4 +365,3 @@ wizard_makeparts(struct gmesh *mesh, con
 
return (0);
 }
-
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318694 - head/usr.sbin/bsdinstall/partedit

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 06:05:54 2017
New Revision: 318694
URL: https://svnweb.freebsd.org/changeset/base/318694

Log:
  style(9): sort headers
  
  MFC after:2 weeks
  MFC with: r318693
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/bsdinstall/partedit/part_wizard.c

Modified: head/usr.sbin/bsdinstall/partedit/part_wizard.c
==
--- head/usr.sbin/bsdinstall/partedit/part_wizard.c Tue May 23 06:04:38 
2017(r318693)
+++ head/usr.sbin/bsdinstall/partedit/part_wizard.c Tue May 23 06:05:54 
2017(r318694)
@@ -27,11 +27,10 @@
  */
 
 #include 
+#include 
 #include 
-#include 
 #include 
-
-#include 
+#include 
 #include 
 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318695 - head/lib/libc/gen

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 06:14:02 2017
New Revision: 318695
URL: https://svnweb.freebsd.org/changeset/base/318695

Log:
  err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`
  
  This is being done to aid humans and static analysis checkers.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/gen/err.c

Modified: head/lib/libc/gen/err.c
==
--- head/lib/libc/gen/err.c Tue May 23 06:05:54 2017(r318694)
+++ head/lib/libc/gen/err.c Tue May 23 06:14:02 2017(r318695)
@@ -97,7 +97,7 @@ void
 verrc(int eval, int code, const char *fmt, va_list ap)
 {
if (err_file == NULL)
-   err_set_file((FILE *)0);
+   err_set_file(NULL);
fprintf(err_file, "%s: ", _getprogname());
if (fmt != NULL) {
vfprintf(err_file, fmt, ap);
@@ -122,7 +122,7 @@ void
 verrx(int eval, const char *fmt, va_list ap)
 {
if (err_file == NULL)
-   err_set_file((FILE *)0);
+   err_set_file(NULL);
fprintf(err_file, "%s: ", _getprogname());
if (fmt != NULL)
vfprintf(err_file, fmt, ap);
@@ -162,7 +162,7 @@ void
 vwarnc(int code, const char *fmt, va_list ap)
 {
if (err_file == NULL)
-   err_set_file((FILE *)0);
+   err_set_file(NULL);
fprintf(err_file, "%s: ", _getprogname());
if (fmt != NULL) {
vfprintf(err_file, fmt, ap);
@@ -184,7 +184,7 @@ void
 vwarnx(const char *fmt, va_list ap)
 {
if (err_file == NULL)
-   err_set_file((FILE *)0);
+   err_set_file(NULL);
fprintf(err_file, "%s: ", _getprogname());
if (fmt != NULL)
vfprintf(err_file, fmt, ap);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318698 - head/lib/libc/gen

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 06:53:31 2017
New Revision: 318698
URL: https://svnweb.freebsd.org/changeset/base/318698

Log:
  basename(3): fix section ordering
  
  IMPLEMENTATION NOTES come before RETURN VALUES
  
  MFC after:2 weeks
  Reported by:  make manlint
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/gen/basename.3

Modified: head/lib/libc/gen/basename.3
==
--- head/lib/libc/gen/basename.3Tue May 23 06:20:24 2017
(r318697)
+++ head/lib/libc/gen/basename.3Tue May 23 06:53:31 2017
(r318698)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 29, 2016
+.Dd May 22, 2017
 .Dt BASENAME 3
 .Os
 .Sh NAME
@@ -34,6 +34,16 @@ function returns the last component from
 deleting any trailing
 .Sq \&/
 characters.
+.Sh IMPLEMENTATION NOTES
+This implementation of
+.Fn basename
+uses the buffer provided by the caller to store the resulting pathname
+component.
+Other vendor implementations may return a pointer to internal storage
+space instead.
+The advantage of the former approach is that it ensures thread-safety,
+while also placing no upper limit on the supported length of the
+pathname.
 .Sh RETURN VALUES
 If
 .Fa path
@@ -50,16 +60,6 @@ is returned.
 Otherwise,
 it returns a pointer to the last component of
 .Fa path .
-.Sh IMPLEMENTATION NOTES
-This implementation of
-.Fn basename
-uses the buffer provided by the caller to store the resulting pathname
-component.
-Other vendor implementations may return a pointer to internal storage
-space instead.
-The advantage of the former approach is that it ensures thread-safety,
-while also placing no upper limit on the supported length of the
-pathname.
 .Sh SEE ALSO
 .Xr basename 1 ,
 .Xr dirname 1 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318699 - head/lib/libc/gen

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 06:55:51 2017
New Revision: 318699
URL: https://svnweb.freebsd.org/changeset/base/318699

Log:
  directory(3): delete trailing whitespace and rewrite `E.g.` as `e.g.`
  
  Reported by:  make manlint
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/gen/directory.3

Modified: head/lib/libc/gen/directory.3
==
--- head/lib/libc/gen/directory.3   Tue May 23 06:53:31 2017
(r318698)
+++ head/lib/libc/gen/directory.3   Tue May 23 06:55:51 2017
(r318699)
@@ -28,7 +28,7 @@
 .\" @(#)directory.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd August 31, 2016
+.Dd May 22, 2017
 .Dt DIRECTORY 3
 .Os
 .Sh NAME
@@ -292,14 +292,15 @@ is likely to be wrong if there are paral
 and the directory is larger than one page.
 There is code to ensure that a
 .Fn seekdir
-to the location given by a 
+to the location given by a
 .Fn telldir
-immediately before the last 
+immediately before the last
 .Fn readdir
 will always set the correct location to return the same value as that last
 .Fn readdir
 performed.
-This is enough for some applications which want to "push back the last entry 
read" E.g. Samba. 
+This is enough for some applications which want to
+"push back the last entry read", e.g. Samba.
 Seeks back to any other location,
 other than the beginning of the directory,
 may result in unexpected behaviour if deletes are present.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318700 - head/lib/libc/gen

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 06:56:57 2017
New Revision: 318700
URL: https://svnweb.freebsd.org/changeset/base/318700

Log:
  dirname(3): fix section ordering
  
  IMPLEMENTATION NOTES come before RETURN VALUES
  
  MFC after:2 weeks
  Reported by:  make manlint
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/gen/dirname.3

Modified: head/lib/libc/gen/dirname.3
==
--- head/lib/libc/gen/dirname.3 Tue May 23 06:55:51 2017(r318699)
+++ head/lib/libc/gen/dirname.3 Tue May 23 06:56:57 2017(r318700)
@@ -37,6 +37,16 @@ Any trailing
 .Sq \&/
 characters are not counted as part of the directory
 name.
+.Sh IMPLEMENTATION NOTES
+This implementation of
+.Fn dirname
+uses the buffer provided by the caller to store the resulting parent
+directory.
+Other vendor implementations may return a pointer to internal storage
+space instead.
+The advantage of the former approach is that it ensures thread-safety,
+while also placing no upper limit on the supported length of the
+pathname.
 .Sh RETURN VALUES
 If
 .Fa path
@@ -50,16 +60,6 @@ signifying the current directory.
 Otherwise,
 it returns a pointer to the parent directory of
 .Fa path .
-.Sh IMPLEMENTATION NOTES
-This implementation of
-.Fn dirname
-uses the buffer provided by the caller to store the resulting parent
-directory.
-Other vendor implementations may return a pointer to internal storage
-space instead.
-The advantage of the former approach is that it ensures thread-safety,
-while also placing no upper limit on the supported length of the
-pathname.
 .Sh SEE ALSO
 .Xr basename 1 ,
 .Xr dirname 1 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318701 - head/lib/libc/gen

2017-05-22 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 06:58:08 2017
New Revision: 318701
URL: https://svnweb.freebsd.org/changeset/base/318701

Log:
  tcsendbreak(3): delete spurious blank line at the end of the man page
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/gen/tcsendbreak.3

Modified: head/lib/libc/gen/tcsendbreak.3
==
--- head/lib/libc/gen/tcsendbreak.3 Tue May 23 06:56:57 2017
(r318700)
+++ head/lib/libc/gen/tcsendbreak.3 Tue May 23 06:58:08 2017
(r318701)
@@ -177,4 +177,3 @@ without writing all output.
 The default value for
 .Va kern.tty_drainwait
 is 300 seconds.
-
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318702 - head/contrib/libc-vis

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:00:46 2017
New Revision: 318702
URL: https://svnweb.freebsd.org/changeset/base/318702

Log:
  vis(3): delete spurious .Pp macro
  
  MFC after:2 weeks
  Reported by:  make manlint
  Sponsored by: Dell EMC Isilon

Modified:
  head/contrib/libc-vis/vis.3

Modified: head/contrib/libc-vis/vis.3
==
--- head/contrib/libc-vis/vis.3 Tue May 23 06:58:08 2017(r318701)
+++ head/contrib/libc-vis/vis.3 Tue May 23 07:00:46 2017(r318702)
@@ -373,7 +373,6 @@ space.
 .It Dv \e240
 Represents Meta-space.
 .El
-.Pp
 .It Dv VIS_CSTYLE
 Use C-style backslash sequences to represent standard non-printable
 characters.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318703 - head/lib/libc/iconv

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:02:01 2017
New Revision: 318703
URL: https://svnweb.freebsd.org/changeset/base/318703

Log:
  __iconv_get_list: separate .Nm entries with commas
  
  MFC after:2 weeks
  Reported by:  make manlint
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/iconv/__iconv_get_list.3

Modified: head/lib/libc/iconv/__iconv_get_list.3
==
--- head/lib/libc/iconv/__iconv_get_list.3  Tue May 23 07:00:46 2017
(r318702)
+++ head/lib/libc/iconv/__iconv_get_list.3  Tue May 23 07:02:01 2017
(r318703)
@@ -38,7 +38,7 @@
 .Dt __ICONV_GET_LIST 3
 .Os
 .Sh NAME
-.Nm __iconv_get_list
+.Nm __iconv_get_list ,
 .Nm __iconv_free_list
 .Nd retrieving a list of character encodings supported by
 .Xr iconv 3
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318704 - head/lib/libc/posix1e

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:05:34 2017
New Revision: 318704
URL: https://svnweb.freebsd.org/changeset/base/318704

Log:
  posix1e(3): reference using the section (3) when referencing libbsm with .Xr
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/posix1e/posix1e.3

Modified: head/lib/libc/posix1e/posix1e.3
==
--- head/lib/libc/posix1e/posix1e.3 Tue May 23 07:02:01 2017
(r318703)
+++ head/lib/libc/posix1e/posix1e.3 Tue May 23 07:05:34 2017
(r318704)
@@ -63,7 +63,7 @@ flow label APIs.
 However,
 .Fx
 does implement the
-.Xr libbsm
+.Xr libbsm 3
 audit API.
 It also provides
 .Xr capsicum 4 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318705 - head/lib/libc/stdio

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:08:30 2017
New Revision: 318705
URL: https://svnweb.freebsd.org/changeset/base/318705

Log:
  fopen(3): make manlint fixes
  
  - Break on new lines.
  - Use .Dv with NULL.
  - Rewrap lines as necessary/when possible.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/stdio/fopen.3

Modified: head/lib/libc/stdio/fopen.3
==
--- head/lib/libc/stdio/fopen.3 Tue May 23 07:05:34 2017(r318704)
+++ head/lib/libc/stdio/fopen.3 Tue May 23 07:08:30 2017(r318705)
@@ -230,15 +230,20 @@ argument,
 .Fn fmemopen
 allocates
 .Fa size
-bytes of memory. This buffer is automatically freed when the
-stream is closed. Buffers can be opened in text-mode (default) or binary-mode
+bytes of memory.
+This buffer is automatically freed when the stream is closed.
+Buffers can be opened in text-mode (default) or binary-mode
 (if
 .Dq Li b
 is present in the second or third position of the
 .Fa mode
-argument). Buffers opened in text-mode make sure that writes are terminated 
with
-a NULL byte, if the last write hasn't filled up the whole buffer. Buffers
-opened in binary-mode never append a NULL byte.
+argument).
+Buffers opened in text-mode make sure that writes are terminated with a
+.Dv NULL
+byte, if the last write hasn't filled up the whole buffer.
+Buffers opened in binary-mode never append a
+.Dv NULL
+byte.
 .Sh RETURN VALUES
 Upon successful completion
 .Fn fopen ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318706 - head/lib/libc/locale

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:09:26 2017
New Revision: 318706
URL: https://svnweb.freebsd.org/changeset/base/318706

Log:
  localeconv(3): start sentences on new lines
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/locale/localeconv.3

Modified: head/lib/libc/locale/localeconv.3
==
--- head/lib/libc/locale/localeconv.3   Tue May 23 07:08:30 2017
(r318705)
+++ head/lib/libc/locale/localeconv.3   Tue May 23 07:09:26 2017
(r318706)
@@ -202,7 +202,8 @@ result similarly denotes an unavailable 
 .Pp
 The
 .Fn localeconv_l
-function takes an explicit locale parameter.  For more information, see
+function takes an explicit locale parameter.
+For more information, see
 .Xr xlocale 3 .
 .Sh RETURN VALUES
 The
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318707 - head/lib/libc/net

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:10:20 2017
New Revision: 318707
URL: https://svnweb.freebsd.org/changeset/base/318707

Log:
  sctp_send(3): start sentences on new lines
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/net/sctp_send.3

Modified: head/lib/libc/net/sctp_send.3
==
--- head/lib/libc/net/sctp_send.3   Tue May 23 07:09:26 2017
(r318706)
+++ head/lib/libc/net/sctp_send.3   Tue May 23 07:10:20 2017
(r318707)
@@ -105,8 +105,8 @@ struct sctp_sndrcvinfo {
 The
 .Fa sinfo->sinfo_ppid
 argument is an opaque 32 bit value that is passed transparently
-through the stack to the peer endpoint. It will be available on
-reception of a message (see
+through the stack to the peer endpoint.
+It will be available on reception of a message (see
 .Xr sctp_recvmsg 3 ) .
 Note that the stack passes this value without regard to byte
 order.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318708 - head/lib/libc/posix1e

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:11:15 2017
New Revision: 318708
URL: https://svnweb.freebsd.org/changeset/base/318708

Log:
  acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/posix1e/acl_create_entry.3

Modified: head/lib/libc/posix1e/acl_create_entry.3
==
--- head/lib/libc/posix1e/acl_create_entry.3Tue May 23 07:10:20 2017
(r318707)
+++ head/lib/libc/posix1e/acl_create_entry.3Tue May 23 07:11:15 2017
(r318708)
@@ -29,7 +29,7 @@
 .Dt ACL_CREATE_ENTRY 3
 .Os
 .Sh NAME
-.Nm acl_create_entry
+.Nm acl_create_entry ,
 .Nm acl_create_entry_np
 .Nd create a new ACL entry
 .Sh LIBRARY
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318709 - head/lib/libc/posix1e

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:12:31 2017
New Revision: 318709
URL: https://svnweb.freebsd.org/changeset/base/318709

Log:
  acl_to_text(3): start sentences on new lines
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/posix1e/acl_to_text.3

Modified: head/lib/libc/posix1e/acl_to_text.3
==
--- head/lib/libc/posix1e/acl_to_text.3 Tue May 23 07:11:15 2017
(r318708)
+++ head/lib/libc/posix1e/acl_to_text.3 Tue May 23 07:12:31 2017
(r318709)
@@ -58,8 +58,9 @@ including the NULL terminator) in the lo
 .Va len_p .
 If the ACL is POSIX.1e, the format of the text string returned by
 .Fn acl_to_text
-shall be the POSIX.1e long ACL form.  If the ACL is NFSv4, the format
-of the text string shall be the compact form, unless the
+shall be the POSIX.1e long ACL form.
+If the ACL is NFSv4, the format of the text string shall be the compact form, 
unless
+the
 .Va ACL_TEXT_VERBOSE
 flag is given.
 .Pp
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318710 - head/lib/libc/stdlib

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:14:46 2017
New Revision: 318710
URL: https://svnweb.freebsd.org/changeset/base/318710

Log:
  quick_exit(3): delete trailing whitespace in licensing tort
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/stdlib/quick_exit.3

Modified: head/lib/libc/stdlib/quick_exit.3
==
--- head/lib/libc/stdlib/quick_exit.3   Tue May 23 07:12:31 2017
(r318709)
+++ head/lib/libc/stdlib/quick_exit.3   Tue May 23 07:14:46 2017
(r318710)
@@ -1,6 +1,6 @@
 .\"  Copyright (c) 2011 David Chisnall
 .\"  All rights reserved.
-.\" 
+.\"
 .\"  Redistribution and use in source and binary forms, with or without
 .\"  modification, are permitted provided that the following conditions
 .\"  are met:
@@ -9,7 +9,7 @@
 .\"  2. Redistributions in binary form must reproduce the above copyright
 .\" notice, this list of conditions and the following disclaimer in the
 .\" documentation and/or other materials provided with the distribution.
-.\" 
+.\"
 .\"  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 .\"  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 .\"  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -21,7 +21,7 @@
 .\"  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 .\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\"  SUCH DAMAGE.
-.\" 
+.\"
 .\"  $FreeBSD$
 .\"
 .Dd December 13, 2014
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318711 - head/lib/libc/stdio

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:15:57 2017
New Revision: 318711
URL: https://svnweb.freebsd.org/changeset/base/318711

Log:
  fopencookie(3): declare function pointers in SYNOPSIS correctly
  
  Add obligatory `*` in declarations.
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/stdio/fopencookie.3

Modified: head/lib/libc/stdio/fopencookie.3
==
--- head/lib/libc/stdio/fopencookie.3   Tue May 23 07:14:46 2017
(r318710)
+++ head/lib/libc/stdio/fopencookie.3   Tue May 23 07:15:57 2017
(r318711)
@@ -35,13 +35,13 @@
 .Sh SYNOPSIS
 .In stdio.h
 .Ft typedef ssize_t
-.Fn (cookie_read_function_t) "void *cookie" "char *buf" "size_t size"
+.Fn (*cookie_read_function_t) "void *cookie" "char *buf" "size_t size"
 .Ft typedef ssize_t
-.Fn (cookie_write_function_t) "void *cookie" "const char *buf" "size_t size"
+.Fn (*cookie_write_function_t) "void *cookie" "const char *buf" "size_t size"
 .Ft typedef int
-.Fn (cookie_seek_function_t) "void *cookie" "off64_t *offset" "int whence"
+.Fn (*cookie_seek_function_t) "void *cookie" "off64_t *offset" "int whence"
 .Ft typedef int
-.Fn (cookie_close_function_t) "void *cookie"
+.Fn (*cookie_close_function_t) "void *cookie"
 .Bd -literal
 typedef struct {
cookie_read_function_t  *read;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318712 - head/lib/libc/xdr

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:17:52 2017
New Revision: 318712
URL: https://svnweb.freebsd.org/changeset/base/318712

Log:
  xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS
  
  This unbreaks the .Nm declaration
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/xdr/xdr.3

Modified: head/lib/libc/xdr/xdr.3
==
--- head/lib/libc/xdr/xdr.3 Tue May 23 07:15:57 2017(r318711)
+++ head/lib/libc/xdr/xdr.3 Tue May 23 07:17:52 2017(r318712)
@@ -31,7 +31,7 @@
 .Nm xdr_reference ,
 .Nm xdr_setpos ,
 .Nm xdr_short ,
-.Nm xdr_sizeof,
+.Nm xdr_sizeof ,
 .Nm xdrstdio_create ,
 .Nm xdr_string ,
 .Nm xdr_u_char ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318715 - head/lib/libc/sys

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:26:45 2017
New Revision: 318715
URL: https://svnweb.freebsd.org/changeset/base/318715

Log:
  _umtx_op(2): fix minor manlint issues
  
  - Sort .Xr entries in SEE ALSO section.
  - Sort SEE ALSO and STANDARDS sections properly, in terms of the
entire document.
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/sys/_umtx_op.2

Modified: head/lib/libc/sys/_umtx_op.2
==
--- head/lib/libc/sys/_umtx_op.2Tue May 23 07:21:26 2017
(r318714)
+++ head/lib/libc/sys/_umtx_op.2Tue May 23 07:26:45 2017
(r318715)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 29, 2016
+.Dd May 23, 2017
 .Dt _UMTX_OP 2
 .Os
 .Sh NAME
@@ -1382,32 +1382,11 @@ Mutex lock requests without timeout spec
 The error is not returned to userspace code since restart
 is handled by usual adjustment of the instruction counter.
 .El
-.Sh BUGS
-A window between a unlocking robust mutex and resetting the pointer in the
-.Dv robust_inact_offset
-member of the registered
-.Vt struct umtx_robust_lists_params
-allows another thread to destroy the mutex, thus making the kernel inspect
-freed or reused memory.
-The
-.Li libthr
-implementation is only vulnerable to this race when operating on
-a shared mutex.
-A possible fix for the current implementation is to strengthen the checks
-for shared mutexes before terminating them, in particular, verifying
-that the mutex memory is mapped from a shared memory object allocated
-by the
-.Dv UMTX_OP_SHM
-request.
-This is not done because it is believed that the race is adequately
-covered by other consistency checks, while adding the check would
-prevent alternative implementations of
-.Li libpthread .
 .Sh SEE ALSO
 .Xr clock_gettime 2 ,
 .Xr mmap 2 ,
-.Xr shm_open 2 ,
 .Xr setrlimit 2 ,
+.Xr shm_open 2 ,
 .Xr sigaction 2 ,
 .Xr thr_exit 2 ,
 .Xr thr_kill 2 ,
@@ -1425,3 +1404,24 @@ to implement
 .St -p1003.1-2001
 .Xr pthread 3
 functionality.
+.Sh BUGS
+A window between a unlocking robust mutex and resetting the pointer in the
+.Dv robust_inact_offset
+member of the registered
+.Vt struct umtx_robust_lists_params
+allows another thread to destroy the mutex, thus making the kernel inspect
+freed or reused memory.
+The
+.Li libthr
+implementation is only vulnerable to this race when operating on
+a shared mutex.
+A possible fix for the current implementation is to strengthen the checks
+for shared mutexes before terminating them, in particular, verifying
+that the mutex memory is mapped from a shared memory object allocated
+by the
+.Dv UMTX_OP_SHM
+request.
+This is not done because it is believed that the race is adequately
+covered by other consistency checks, while adding the check would
+prevent alternative implementations of
+.Li libpthread .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318717 - head/lib/libc/sys

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:31:03 2017
New Revision: 318717
URL: https://svnweb.freebsd.org/changeset/base/318717

Log:
  cap_enter(2): fix manlint issues
  
  - Sort SEE ALSO section appropriately.
  - Correct section for sysctl(9).
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/sys/cap_enter.2

Modified: head/lib/libc/sys/cap_enter.2
==
--- head/lib/libc/sys/cap_enter.2   Tue May 23 07:27:30 2017
(r318716)
+++ head/lib/libc/sys/cap_enter.2   Tue May 23 07:31:03 2017
(r318717)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 27, 2016
+.Dd May 23, 2017
 .Dt CAP_ENTER 2
 .Os
 .Sh NAME
@@ -144,11 +144,11 @@ points outside the process's allocated a
 .Xr cap_fcntls_limit 2 ,
 .Xr cap_ioctls_limit 2 ,
 .Xr cap_rights_limit 2 ,
-.Xr procctl 2 ,
-.Xr sysctl 2 ,
 .Xr fexecve 2 ,
+.Xr procctl 2 ,
 .Xr cap_sandboxed 3 ,
-.Xr capsicum 4
+.Xr capsicum 4 ,
+.Xr sysctl 9
 .Sh HISTORY
 Support for capabilities and capabilities mode was developed as part of the
 .Tn TrustedBSD
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318718 - head/lib/libc/sys

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:32:57 2017
New Revision: 318718
URL: https://svnweb.freebsd.org/changeset/base/318718

Log:
  rctl_add_rule(2): fix manlint warnings
  
  - Fix commas (either missing or misused) after .Nm entries in SYNOPSIS
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/sys/rctl_add_rule.2

Modified: head/lib/libc/sys/rctl_add_rule.2
==
--- head/lib/libc/sys/rctl_add_rule.2   Tue May 23 07:31:03 2017
(r318717)
+++ head/lib/libc/sys/rctl_add_rule.2   Tue May 23 07:32:57 2017
(r318718)
@@ -28,10 +28,10 @@
 .Dt RCTL_ADD_RULE 2
 .Os
 .Sh NAME
-.Nm rctl_add_rule,
-.Nm rctl_get_limits
-.Nm rctl_get_racct,
-.Nm rctl_get_rules,
+.Nm rctl_add_rule ,
+.Nm rctl_get_limits ,
+.Nm rctl_get_racct ,
+.Nm rctl_get_rules ,
 .Nm rctl_remove_rule
 .Nd manipulate and query the resource limits database
 .Sh LIBRARY
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318719 - head/lib/libc/sys

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:44:43 2017
New Revision: 318719
URL: https://svnweb.freebsd.org/changeset/base/318719

Log:
  open(2): fix manlint warnings
  
  - Sort SEE ALSO .Xr entries.
  - Sort sections (HISTORY comes after STANDARDS).
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/sys/open.2

Modified: head/lib/libc/sys/open.2
==
--- head/lib/libc/sys/open.2Tue May 23 07:32:57 2017(r318718)
+++ head/lib/libc/sys/open.2Tue May 23 07:44:43 2017(r318719)
@@ -490,7 +490,6 @@ was called and the process is in capabil
 is an absolute path or contained "..".
 .El
 .Sh SEE ALSO
-.Xr capsicum 4 ,
 .Xr chmod 2 ,
 .Xr close 2 ,
 .Xr dup 2 ,
@@ -503,16 +502,8 @@ is an absolute path or contained "..".
 .Xr read 2 ,
 .Xr umask 2 ,
 .Xr write 2 ,
-.Xr fopen 3
-.Sh HISTORY
-The
-.Fn open
-function appeared in
-.At v6 .
-The
-.Fn openat
-function was introduced in
-.Fx 8.0 .
+.Xr fopen 3 ,
+.Xr capsicum 4
 .Sh STANDARDS
 These functions are specified by
 .St -p1003.1-2008 .
@@ -529,6 +520,15 @@ when
 is set in flags and the final component of pathname is a symbolic link
 to distinguish it from the case of too many symbolic link traversals
 in one of its non-final components.
+.Sh HISTORY
+The
+.Fn open
+function appeared in
+.At v6 .
+The
+.Fn openat
+function was introduced in
+.Fx 8.0 .
 .Sh BUGS
 The Open Group Extended API Set 2 specification requires that the test
 for whether
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318720 - head/lib/libc/sys

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:45:29 2017
New Revision: 318720
URL: https://svnweb.freebsd.org/changeset/base/318720

Log:
  ptrace(2): clean up trailing whitespace
  
  Reviewed by:  make manlint
  MFC after:2 weeks

Modified:
  head/lib/libc/sys/ptrace.2

Modified: head/lib/libc/sys/ptrace.2
==
--- head/lib/libc/sys/ptrace.2  Tue May 23 07:44:43 2017(r318719)
+++ head/lib/libc/sys/ptrace.2  Tue May 23 07:45:29 2017(r318720)
@@ -166,7 +166,7 @@ new child processes will execute without
 This event flag controls tracing of LWP
 .Pq kernel thread
 creation and destruction.
-When this event is enabled, 
+When this event is enabled,
 new LWPs will stop and report an event with
 .Dv PL_FLAG_BORN
 set before executing their first instruction,
@@ -215,7 +215,7 @@ or
 includes only
 .Dv PTRACE_EXEC
 events.
-All other event flags are disabled. 
+All other event flags are disabled.
 .Pp
 The
 .Fa request
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318721 - head/lib/libc/sys

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:46:10 2017
New Revision: 318721
URL: https://svnweb.freebsd.org/changeset/base/318721

Log:
  kill(2): add missing section for sysctl(9)
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/sys/kill.2

Modified: head/lib/libc/sys/kill.2
==
--- head/lib/libc/sys/kill.2Tue May 23 07:45:29 2017(r318720)
+++ head/lib/libc/sys/kill.2Tue May 23 07:46:10 2017(r318721)
@@ -71,7 +71,7 @@ A single exception is the signal SIGCONT
 to any process with the same session ID as the sender.
 In addition, if the
 .Va security.bsd.conservative_signals
-.Xr sysctl
+.Xr sysctl 9
 is set to 1, the user is not a super-user, and
 the receiver is set-uid, then
 only job control and terminal control signals may
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318722 - head/usr.sbin/bsdinstall/partedit

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 07:50:42 2017
New Revision: 318722
URL: https://svnweb.freebsd.org/changeset/base/318722

Log:
  sade(8): start new sentence on new line
  
  Reported by:  make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/bsdinstall/partedit/sade.8

Modified: head/usr.sbin/bsdinstall/partedit/sade.8
==
--- head/usr.sbin/bsdinstall/partedit/sade.8Tue May 23 07:46:10 2017
(r318721)
+++ head/usr.sbin/bsdinstall/partedit/sade.8Tue May 23 07:50:42 2017
(r318722)
@@ -59,7 +59,8 @@ first appeared in
 .Fx 6.3
 as a utility encapsulating features from the
 .Xr sysinstall 8
-installer. It was replaced in
+installer.
+It was replaced in
 .Fx 10.0
 with the equivalent part of
 .Xr bsdinstall 8 .
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318723 - head/usr.sbin/bsdinstall

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 08:01:11 2017
New Revision: 318723
URL: https://svnweb.freebsd.org/changeset/base/318723

Log:
  bsdinstall(8): fix manpage issues
  
  - Start new sentences on new lines.
  - Separate e.g. (more of an igor thing) with commas, and rewrite some examples
not to be enclosed in parentheses.
  
  Reported by:  igor, make manlint
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/bsdinstall/bsdinstall.8

Modified: head/usr.sbin/bsdinstall/bsdinstall.8
==
--- head/usr.sbin/bsdinstall/bsdinstall.8   Tue May 23 07:50:42 2017
(r318722)
+++ head/usr.sbin/bsdinstall/bsdinstall.8   Tue May 23 08:01:11 2017
(r318723)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 31, 2014
+.Dd May 23, 2017
 .Dt BSDINSTALL 8
 .Os
 .Sh NAME
@@ -39,17 +39,18 @@
 .Sh DESCRIPTION
 .Nm
 is used for installation of new systems, both for system setup from
-installation media (e.g. CD-ROMs) and for use on live systems to prepare
+installation media, e.g., CD-ROMs, and for use on live systems to prepare
 VM images and jails.
 .Pp
 Much like
 .Xr make 1 , Nm
-takes a target and possible parameters of the target as arguments. If
-invoked with no arguments, it will invoke the
+takes a target and possible parameters of the target as arguments.
+If invoked with no arguments, it will invoke the
 .Cm auto
 target, which provides a standard interactive installation, invoking the
-others in sequence. To perform a scripted installation, these subtargets
-can be invoked separately by an installation script.
+others in sequence.
+To perform a scripted installation,
+these subtargets can be invoked separately by an installation script.
 .Sh OPTIONS
 .Nm
 supports the following options, global to all targets:
@@ -115,7 +116,8 @@ If
 is set, also configures the network interfaces of the current system to match.
 .It Cm autopart
 Provides the installer's interactive guided disk partitioner for single-disk
-installations. Defaults to UFS.
+installations.
+Defaults to UFS.
 .It Cm zfsboot
 Provides an alternative ZFS-only automatic interactive disk partitioner.
 Creates a single
@@ -135,8 +137,8 @@ to encrypt the disk.
 Provides the installer's interactive manual disk partitioner with an interface
 identical to
 .Xr sade 8 .
-Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS
-is set up with one pool and dataset per partition.
+Supports multiple disks as well as UFS, ZFS, and FAT file systems.
+ZFS is set up with one pool and dataset per partition.
 .It Cm scriptedpart Ar parameters
 Sets up disks like
 .Cm autopart
@@ -150,14 +152,16 @@ Each disk setup is specified by a three-
 .Op Ar scheme
 .Op Ar {partitions}
 .Pp
-Multiple disk setups are separated by semicolons. The
+Multiple disk setups are separated by semicolons.
+The
 .Ar disk
 argument specifies the disk on which to operate (which will be erased),
 while the
 .Ar scheme
 argument specifies the
 .Xr gpart 8
-partition scheme to apply to the disk. If
+partition scheme to apply to the disk.
+If
 .Ar scheme
 is unspecified,
 .Cm scriptedpart
@@ -167,7 +171,8 @@ The
 argument is also optional and specifies how to partition
 .Ar disk .
 It consists of a comma-separated list of partitions to create enclosed in
-curly braces. Each partition declaration takes the form
+curly braces.
+Each partition declaration takes the form
 .Pp
 .Ar size
 .Ar type
@@ -178,15 +183,17 @@ specifies the partition size to create i
 can be appended to specify kilobytes, megabytes, and gigabytes respectively),
 while the
 .Em auto
-keyword causes the partition to take all the remaining space on the disk. The
+keyword causes the partition to take all the remaining space on the disk.
+The
 .Ar type
 option chooses the
 .Xr gpart 8
-filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap).
+filesystem type, e.g., freebsd-ufs, freebsd-zfs, or freebsd-swap.
 The optional
 .Ar mount point
 argument sets where the created partition is to be mounted in the installed
-system. As an example, a typical invocation looks like:
+system.
+As an example, a typical invocation looks like:
 .Pp
 bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G 
freebsd-ufs /var, auto freebsd-ufs /usr }
 .Pp
@@ -238,37 +245,43 @@ Reads a small amount of data from
 .Pa /dev/random
 and stores it in a file in the new system's root directory.
 .It Cm config
-Installs the configuration files destined for the new system (e.g. rc.conf
+Installs the configuration files destined for the new system, e.g.,
+.Xr rc.conf 5
 fragments generated by
 .Cm netconfig ,
 etc.) onto the new system.
 .El
 .Sh ENVIRONMENT VARIABLES
 The following environment variables control various aspects of the installation
-process. Many are used internally during installation and have reasonable
-default values for most installation scenarios. Others are set by various
-interactive

svn commit: r318753 - head/lib/libc/gen

2017-05-23 Thread Ngie Cooper
Author: ngie
Date: Tue May 23 17:34:10 2017
New Revision: 318753
URL: https://svnweb.freebsd.org/changeset/base/318753

Log:
  directory(3): add trailing comma after e.g., missed in r318699
  
  Submitted by: bjk
  MFC after:2 weeks
  MFC with: r318699
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/gen/directory.3

Modified: head/lib/libc/gen/directory.3
==
--- head/lib/libc/gen/directory.3   Tue May 23 17:00:56 2017
(r318752)
+++ head/lib/libc/gen/directory.3   Tue May 23 17:34:10 2017
(r318753)
@@ -300,7 +300,7 @@ will always set the correct location to 
 .Fn readdir
 performed.
 This is enough for some applications which want to
-"push back the last entry read", e.g. Samba.
+"push back the last entry read", e.g., Samba.
 Seeks back to any other location,
 other than the beginning of the directory,
 may result in unexpected behaviour if deletes are present.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319002 - head/usr.bin/grep/tests

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sat May 27 22:40:20 2017
New Revision: 319002
URL: https://svnweb.freebsd.org/changeset/base/319002

Log:
  :rgrep : use atf-check to check the exit code/save the output of grep -r 
instead
  of calling grep -r without it, and saving the output to a file
  
  This ensures that any errors thrown via grep -r are caught, not lost, and uses
  existing atf-sh idioms for saving files.
  
  Tested with:  bsdgrep, gnu grep (base, ports)
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/grep/tests/grep_freebsd_test.sh

Modified: head/usr.bin/grep/tests/grep_freebsd_test.sh
==
--- head/usr.bin/grep/tests/grep_freebsd_test.shSat May 27 21:46:00 
2017(r319001)
+++ head/usr.bin/grep/tests/grep_freebsd_test.shSat May 27 22:40:20 
2017(r319002)
@@ -77,8 +77,7 @@ rgrep_head()
 }
 rgrep_body()
 {
-   grep -r --exclude="*.out" -e "test" "$(atf_get_srcdir)" > 
d_grep_r_implied.out
-
+   atf_check -o save:d_grep_r_implied.out grep -r --exclude="*.out" -e 
"test" "$(atf_get_srcdir)"
atf_check -o file:d_grep_r_implied.out rgrep --exclude="*.out" -e 
"test" "$(atf_get_srcdir)"
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319008 - head/lib/libkvm/tests

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sat May 27 23:19:32 2017
New Revision: 319008
URL: https://svnweb.freebsd.org/changeset/base/319008

Log:
  kvm_geterr_test: Compile out the portions that require kvm_open2(3) on
  systems that lack the libcall, based on __FreeBSD_version.
  
  kvm_open2(3) wasn't made available until r291406, which is in ^/stable/11,
  but not ^/stable/10. This makes some of kvm_geterr_test available for testing
  on ^/stable/10.
  
  MFC after:now
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libkvm/tests/kvm_geterr_test.c

Modified: head/lib/libkvm/tests/kvm_geterr_test.c
==
--- head/lib/libkvm/tests/kvm_geterr_test.c Sat May 27 23:04:48 2017
(r319007)
+++ head/lib/libkvm/tests/kvm_geterr_test.c Sat May 27 23:19:32 2017
(r319008)
@@ -65,6 +65,8 @@ ATF_TC_HEAD(kvm_geterr_positive_test_err
atf_tc_set_md_var(tc, "require.user", "root");
 }
 
+/* 1100090 was where kvm_open2(3) was introduced. */
+#if __FreeBSD_version >= 1100091
 ATF_TC_BODY(kvm_geterr_positive_test_error, tc)
 {
kvm_t *kd;
@@ -125,13 +127,16 @@ ATF_TC_BODY(kvm_geterr_positive_test_no_
ATF_REQUIRE_MSG(kvm_close(kd) == 0, "kvm_close failed: %s",
strerror(errno));
 }
+#endif
 
 ATF_TP_ADD_TCS(tp)
 {
 
ATF_TP_ADD_TC(tp, kvm_geterr_negative_test_NULL);
+#if __FreeBSD_version >= 1100091
ATF_TP_ADD_TC(tp, kvm_geterr_positive_test_error);
ATF_TP_ADD_TC(tp, kvm_geterr_positive_test_no_error);
+#endif
 
return (atf_no_error());
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319010 - head/lib/libkvm/tests

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sat May 27 23:23:22 2017
New Revision: 319010
URL: https://svnweb.freebsd.org/changeset/base/319010

Log:
  Fix #if conditional added in r319008
  
  I committed an earlier version of the file by accident
  
  This is a no-op on ^/head and ^/stable/11.
  
  MFC after:now
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libkvm/tests/kvm_geterr_test.c

Modified: head/lib/libkvm/tests/kvm_geterr_test.c
==
--- head/lib/libkvm/tests/kvm_geterr_test.c Sat May 27 23:20:28 2017
(r319009)
+++ head/lib/libkvm/tests/kvm_geterr_test.c Sat May 27 23:23:22 2017
(r319010)
@@ -56,6 +56,8 @@ ATF_TC_BODY(kvm_geterr_negative_test_NUL
ATF_REQUIRE(!errbuf_has_error(kvm_geterr(NULL)));
 }
 
+/* 1100090 was where kvm_open2(3) was introduced. */
+#if __FreeBSD_version >= 1100091
 ATF_TC(kvm_geterr_positive_test_error);
 ATF_TC_HEAD(kvm_geterr_positive_test_error, tc)
 {
@@ -65,8 +67,6 @@ ATF_TC_HEAD(kvm_geterr_positive_test_err
atf_tc_set_md_var(tc, "require.user", "root");
 }
 
-/* 1100090 was where kvm_open2(3) was introduced. */
-#if __FreeBSD_version >= 1100091
 ATF_TC_BODY(kvm_geterr_positive_test_error, tc)
 {
kvm_t *kd;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319015 - head/tools/regression/geom_gpt

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sat May 27 23:57:09 2017
New Revision: 319015
URL: https://svnweb.freebsd.org/changeset/base/319015

Log:
  Use calloc instead of malloc + memset
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/tools/regression/geom_gpt/gctl_test_helper.c

Modified: head/tools/regression/geom_gpt/gctl_test_helper.c
==
--- head/tools/regression/geom_gpt/gctl_test_helper.c   Sat May 27 23:31:59 
2017(r319014)
+++ head/tools/regression/geom_gpt/gctl_test_helper.c   Sat May 27 23:57:09 
2017(r319015)
@@ -87,10 +87,9 @@ parse(char *arg, char **param, char **va
return (EINVAL);
if (*len <= 0 || *len > PATH_MAX)
return (EINVAL);
-   *value = malloc(*len);
+   *value = calloc(*len, sizeof(char));
if (*value == NULL)
return (ENOMEM);
-   memset(*value, 0, *len);
if (equal != NULL) {
if (strlen(equal) >= PATH_MAX)
return (ENOMEM);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319019 - head/lib/libgeom

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 00:28:11 2017
New Revision: 319019
URL: https://svnweb.freebsd.org/changeset/base/319019

Log:
  Remove getpagesize(3) error checking added in r317312
  
  getpagesize(3) no longer fails as of r317436.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libgeom/geom_stats.c

Modified: head/lib/libgeom/geom_stats.c
==
--- head/lib/libgeom/geom_stats.c   Sun May 28 00:25:44 2017
(r319018)
+++ head/lib/libgeom/geom_stats.c   Sun May 28 00:28:11 2017
(r319019)
@@ -87,8 +87,6 @@ geom_stats_open(void)
if (statsfd < 0)
return (errno);
pagesize = getpagesize();
-   if (pagesize == -1)
-   return (errno);
spp = pagesize / sizeof(struct devstat);
p = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, statsfd, 0);
if (p == MAP_FAILED) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319026 - head/usr.sbin/pw/tests

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 02:15:57 2017
New Revision: 319026
URL: https://svnweb.freebsd.org/changeset/base/319026

Log:
  pw: add some basic testcases for groupshow and usershow
  
  - groupshow: test out -a/-g/-n .
  - usershow: test out -a/-n/-u .
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Added:
  head/usr.sbin/pw/tests/pw_groupshow_test.sh   (contents, props changed)
  head/usr.sbin/pw/tests/pw_usershow_test.sh   (contents, props changed)
Modified:
  head/usr.sbin/pw/tests/Makefile

Modified: head/usr.sbin/pw/tests/Makefile
==
--- head/usr.sbin/pw/tests/Makefile Sun May 28 01:14:59 2017
(r319025)
+++ head/usr.sbin/pw/tests/Makefile Sun May 28 02:15:57 2017
(r319026)
@@ -14,10 +14,12 @@ ATF_TESTS_SH=   pw_etcdir_test \
pw_groupadd_test \
pw_groupdel_test \
pw_groupmod_test \
+   pw_groupshow_test \
pw_useradd_test \
pw_userdel_test \
pw_usermod_test \
-   pw_usernext_test
+   pw_usernext_test \
+   pw_usershow_test
 
 .for tp in ${ATF_TESTS_SH}
 TEST_METADATA.${tp}+=  required_user="root"

Added: head/usr.sbin/pw/tests/pw_groupshow_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/pw/tests/pw_groupshow_test.sh Sun May 28 02:15:57 2017
(r319026)
@@ -0,0 +1,56 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+atf_test_case group_show_all
+group_show_all_body() {
+   populate_etc_skel
+   atf_check -o not-empty ${PW} groupshow -a
+}
+
+atf_test_case group_show_gid
+group_show_gid_body() {
+   populate_etc_skel
+   atf_check -o not-empty ${PW} groupshow -g 0
+}
+
+atf_test_case group_show_name
+group_show_name_body() {
+   populate_etc_skel
+   atf_check -o not-empty ${PW} groupshow wheel
+}
+
+atf_test_case group_show_nonexistent_gid
+group_show_nonexistent_gid_body() {
+   populate_etc_skel
+
+   nonexistent_gid=4242
+   no_such_name_msg="pw: unknown gid \`$nonexistent_gid'\n"
+
+   atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \
+   $nonexistent_gid
+   atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \
+   -g $nonexistent_gid
+}
+
+atf_test_case group_show_nonexistent_name
+group_show_nonexistent_name_body() {
+   populate_etc_skel
+
+   nonexistent_name=bogus
+   no_such_name_msg="pw: unknown group \`$nonexistent_name'\n"
+
+   atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \
+   $nonexistent_name
+   atf_check -e "inline:$no_such_name_msg" -s exit:65 ${PW} groupshow \
+   -n $nonexistent_name
+}
+
+atf_init_test_cases() {
+   atf_add_test_case group_show_all
+   atf_add_test_case group_show_gid
+   atf_add_test_case group_show_name
+   atf_add_test_case group_show_nonexistent_gid
+   atf_add_test_case group_show_nonexistent_name
+}

Added: head/usr.sbin/pw/tests/pw_usershow_test.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/pw/tests/pw_usershow_test.sh  Sun May 28 02:15:57 2017
(r319026)
@@ -0,0 +1,56 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+atf_test_case user_show_all
+user_show_all_body() {
+   populate_etc_skel
+   atf_check -o not-empty ${PW} usershow -a
+}
+
+atf_test_case user_show_name
+user_show_name_body() {
+   populate_etc_skel
+   atf_check -o not-empty ${PW} usershow root
+}
+
+atf_test_case user_show_nonexistent_name
+user_show_nonexistent_name_body() {
+   populate_etc_skel
+
+   nonexistent_user=bogus
+   no_such_user_msg="pw: no such user \`$nonexistent_user'\n"
+
+   atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \
+   $nonexistent_user
+   atf_check -e "inline:$no_such_user_msg" -s exit:67 ${PW} usershow \
+   -n $nonexistent_user
+}
+
+atf_test_case user_show_nonexistent_uid
+user_show_nonexistent_uid_body() {
+   populate_etc_skel
+
+   nonexistent_uid=4242
+   no_such_uid_msg="pw: no such uid \`$nonexistent_uid'\n"
+
+   atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \
+   $nonexistent_uid
+   atf_check -e "inline:$no_such_uid_msg" -s exit:67 ${PW} usershow \
+   -u $nonexistent_uid
+}
+
+atf_test_case user_show_uid
+user_show_uid_body() {
+   populate_etc_skel
+   atf_check -o not-empty ${PW} usershow -u 0
+}
+
+atf_init_test_cases() {
+   atf_add_test_case user_show_all
+   atf_add_test_case user_show_name
+   atf_add_tes

svn commit: r319027 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 02:55:04 2017
New Revision: 319027
URL: https://svnweb.freebsd.org/changeset/base/319027

Log:
  lib/libc/tests/nss: use calloc appropriately
  
  The pattern used prior to this commit was `calloc(1, n * sizeof(type))`;
  the pattern that should be used however is `calloc(n, sizeof(type))`.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getgr_test.c
  head/lib/libc/tests/nss/gethostby_test.c
  head/lib/libc/tests/nss/getproto_test.c
  head/lib/libc/tests/nss/getrpc_test.c
  head/lib/libc/tests/nss/getserv_test.c

Modified: head/lib/libc/tests/nss/getgr_test.c
==
--- head/lib/libc/tests/nss/getgr_test.cSun May 28 02:15:57 2017
(r319026)
+++ head/lib/libc/tests/nss/getgr_test.cSun May 28 02:55:04 2017
(r319027)
@@ -104,7 +104,7 @@ clone_group(struct group *dest, struct g
for (cp = src->gr_mem; *cp; ++cp)
++members_num;
 
-   dest->gr_mem = calloc(1, (members_num + 1) * sizeof(char *));
+   dest->gr_mem = calloc(members_num + 1, sizeof(char *));
ATF_REQUIRE(dest->gr_mem != NULL);
 
for (cp = src->gr_mem; *cp; ++cp) {

Modified: head/lib/libc/tests/nss/gethostby_test.c
==
--- head/lib/libc/tests/nss/gethostby_test.cSun May 28 02:15:57 2017
(r319026)
+++ head/lib/libc/tests/nss/gethostby_test.cSun May 28 02:55:04 2017
(r319027)
@@ -163,8 +163,7 @@ clone_hostent(struct hostent *dest, stru
for (cp = src->h_aliases; *cp; ++cp)
++aliases_num;
 
-   dest->h_aliases = calloc(1, (aliases_num + 1) *
-   sizeof(char *));
+   dest->h_aliases = calloc(aliases_num + 1, sizeof(char *));
ATF_REQUIRE(dest->h_aliases != NULL);
 
for (cp = src->h_aliases; *cp; ++cp) {
@@ -178,7 +177,7 @@ clone_hostent(struct hostent *dest, stru
for (cp = src->h_addr_list; *cp; ++cp)
++addrs_num;
 
-   dest->h_addr_list = calloc(1, (addrs_num + 1) * sizeof(char *));
+   dest->h_addr_list = calloc(addrs_num + 1, sizeof(char *));
ATF_REQUIRE(dest->h_addr_list != NULL);
 
for (cp = src->h_addr_list; *cp; ++cp) {

Modified: head/lib/libc/tests/nss/getproto_test.c
==
--- head/lib/libc/tests/nss/getproto_test.c Sun May 28 02:15:57 2017
(r319026)
+++ head/lib/libc/tests/nss/getproto_test.c Sun May 28 02:55:04 2017
(r319027)
@@ -99,7 +99,7 @@ clone_protoent(struct protoent *dest, st
for (cp = src->p_aliases; *cp; ++cp)
++aliases_num;
 
-   dest->p_aliases = calloc(1, (aliases_num+1) * sizeof(char *));
+   dest->p_aliases = calloc(aliases_num + 1, sizeof(char *));
assert(dest->p_aliases != NULL);
 
for (cp = src->p_aliases; *cp; ++cp) {

Modified: head/lib/libc/tests/nss/getrpc_test.c
==
--- head/lib/libc/tests/nss/getrpc_test.c   Sun May 28 02:15:57 2017
(r319026)
+++ head/lib/libc/tests/nss/getrpc_test.c   Sun May 28 02:55:04 2017
(r319027)
@@ -100,7 +100,7 @@ clone_rpcent(struct rpcent *dest, struct
for (cp = src->r_aliases; *cp; ++cp)
++aliases_num;
 
-   dest->r_aliases = calloc(1, (aliases_num + 1) * sizeof(char *));
+   dest->r_aliases = calloc(aliases_num + 1, sizeof(char *));
ATF_REQUIRE(dest->r_aliases != NULL);
 
for (cp = src->r_aliases; *cp; ++cp) {

Modified: head/lib/libc/tests/nss/getserv_test.c
==
--- head/lib/libc/tests/nss/getserv_test.c  Sun May 28 02:15:57 2017
(r319026)
+++ head/lib/libc/tests/nss/getserv_test.c  Sun May 28 02:55:04 2017
(r319027)
@@ -102,7 +102,7 @@ clone_servent(struct servent *dest, stru
for (cp = src->s_aliases; *cp; ++cp)
++aliases_num;
 
-   dest->s_aliases = calloc(1, (aliases_num + 1) * sizeof(char *));
+   dest->s_aliases = calloc(aliases_num + 1, sizeof(char *));
ATF_REQUIRE(dest->s_aliases != NULL);
 
for (cp = src->s_aliases; *cp; ++cp) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319028 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 03:39:24 2017
New Revision: 319028
URL: https://svnweb.freebsd.org/changeset/base/319028

Log:
  Sort make variables to suit style.Makefile(5)
  
  This is being done prior to functional changes.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/Makefile

Modified: head/lib/libc/tests/nss/Makefile
==
--- head/lib/libc/tests/nss/MakefileSun May 28 02:55:04 2017
(r319027)
+++ head/lib/libc/tests/nss/MakefileSun May 28 03:39:24 2017
(r319028)
@@ -1,18 +1,13 @@
 # $FreeBSD$
 
+.PATH: ${.CURDIR:H}/resolv
+
 PACKAGE=   tests
 
 TESTSDIR=  ${TESTSBASE}/lib/libc/nss
 
 BINDIR=${TESTSDIR}
 
-.PATH: ${.CURDIR:H}/resolv
-
-${PACKAGE}FILES+=  mach
-
-WARNS?=1
-CFLAGS+=   -I${SRCTOP}/tests
-
 ATF_TESTS_C+=  getaddrinfo_test
 ATF_TESTS_C+=  getgr_test
 ATF_TESTS_C+=  gethostby_test
@@ -23,4 +18,10 @@ ATF_TESTS_C+=getrpc_test
 ATF_TESTS_C+=  getserv_test
 ATF_TESTS_C+=  getusershell_test
 
+${PACKAGE}FILES+=  mach
+
+WARNS?=1
+
+CFLAGS+=   -I${SRCTOP}/tests
+
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319029 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 03:42:49 2017
New Revision: 319029
URL: https://svnweb.freebsd.org/changeset/base/319029

Log:
  Staticize functions and remove unused variables to aid with bumping WARNS
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getaddrinfo_test.c
  head/lib/libc/tests/nss/getgr_test.c
  head/lib/libc/tests/nss/getpw_test.c
  head/lib/libc/tests/nss/getusershell_test.c

Modified: head/lib/libc/tests/nss/getaddrinfo_test.c
==
--- head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 03:39:24 2017
(r319028)
+++ head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 03:42:49 2017
(r319029)
@@ -144,7 +144,7 @@ compare_addrinfo(struct addrinfo *ai1, s
return (rv);
 }
 
-void
+static void
 free_addrinfo(struct addrinfo *ai)
 {
if (ai == NULL)
@@ -409,7 +409,7 @@ addrinfo_read_hostlist_func(struct addri
return (0);
 }
 
-void
+static void
 run_tests(char *hostlist_file, char *snapshot_file, int ai_family)
 {
struct addrinfo_test_data td, td_snap;

Modified: head/lib/libc/tests/nss/getgr_test.c
==
--- head/lib/libc/tests/nss/getgr_test.cSun May 28 03:39:24 2017
(r319028)
+++ head/lib/libc/tests/nss/getgr_test.cSun May 28 03:42:49 2017
(r319029)
@@ -49,8 +49,6 @@ enum test_methods {
TEST_BUILD_SNAPSHOT = 16,
 };
 
-static enum test_methods method = TEST_BUILD_SNAPSHOT;
-
 DECLARE_TEST_DATA(group)
 DECLARE_TEST_FILE_SNAPSHOT(group)
 DECLARE_1PASS_TEST(group)

Modified: head/lib/libc/tests/nss/getpw_test.c
==
--- head/lib/libc/tests/nss/getpw_test.cSun May 28 03:39:24 2017
(r319028)
+++ head/lib/libc/tests/nss/getpw_test.cSun May 28 03:42:49 2017
(r319029)
@@ -47,8 +47,6 @@ enum test_methods {
TEST_BUILD_SNAPSHOT
 };
 
-static enum test_methods method = TEST_BUILD_SNAPSHOT;
-
 DECLARE_TEST_DATA(passwd)
 DECLARE_TEST_FILE_SNAPSHOT(passwd)
 DECLARE_1PASS_TEST(passwd)

Modified: head/lib/libc/tests/nss/getusershell_test.c
==
--- head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:39:24 2017
(r319028)
+++ head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:42:49 2017
(r319029)
@@ -48,8 +48,6 @@ struct usershell {
char *path;
 };
 
-static enum test_methods method = TEST_GETUSERSHELL;
-
 DECLARE_TEST_DATA(usershell)
 DECLARE_TEST_FILE_SNAPSHOT(usershell)
 DECLARE_2PASS_TEST(usershell)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319030 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 03:47:58 2017
New Revision: 319030
URL: https://svnweb.freebsd.org/changeset/base/319030

Log:
  Fix -Wsign-compare warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getgr_test.c

Modified: head/lib/libc/tests/nss/getgr_test.c
==
--- head/lib/libc/tests/nss/getgr_test.cSun May 28 03:42:49 2017
(r319029)
+++ head/lib/libc/tests/nss/getgr_test.cSun May 28 03:47:58 2017
(r319030)
@@ -177,7 +177,7 @@ sdump_group(struct group *grp, char *buf
written = snprintf(buffer, buflen, "%s:%s:%d:",
grp->gr_name, grp->gr_passwd, grp->gr_gid);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
@@ -187,7 +187,7 @@ sdump_group(struct group *grp, char *buf
written = snprintf(buffer, buflen, "%s%s",
cp == grp->gr_mem ? "" : ",", *cp);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319031 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 03:58:36 2017
New Revision: 319031
URL: https://svnweb.freebsd.org/changeset/base/319031

Log:
  getusershell_test: staticize run_tests(..) to fix warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getusershell_test.c

Modified: head/lib/libc/tests/nss/getusershell_test.c
==
--- head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:47:58 2017
(r319030)
+++ head/lib/libc/tests/nss/getusershell_test.c Sun May 28 03:58:36 2017
(r319031)
@@ -132,7 +132,7 @@ usershell_read_snapshot_func(struct user
return (0);
 }
 
-int
+static int
 run_tests(const char *snapshot_file, enum test_methods method)
 {
struct usershell_test_data td, td_snap;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319034 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:03:45 2017
New Revision: 319034
URL: https://svnweb.freebsd.org/changeset/base/319034

Log:
  getaddrinfo_test: fix -Wsign-compare warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getaddrinfo_test.c

Modified: head/lib/libc/tests/nss/getaddrinfo_test.c
==
--- head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 04:03:06 2017
(r319033)
+++ head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 04:03:45 2017
(r319034)
@@ -164,30 +164,30 @@ sdump_addrinfo(struct addrinfo *ai, char
ai->ai_flags, ai->ai_family, ai->ai_socktype, ai->ai_protocol,
ai->ai_addrlen);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
written = snprintf(buffer, buflen, "%s ",
ai->ai_canonname == NULL ? "(null)" : ai->ai_canonname);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
if (ai->ai_addr == NULL) {
written = snprintf(buffer, buflen, "(null)");
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
} else {
-   for (i = 0; i < ai->ai_addrlen; i++) {
+   for (i = 0; i < (int)ai->ai_addrlen; i++) {
written = snprintf(buffer, buflen,
-   i + 1 != ai->ai_addrlen ? "%d." : "%d",
+   i + 1 != (int)ai->ai_addrlen ? "%d." : "%d",
((unsigned char *)ai->ai_addr)[i]);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
@@ -199,7 +199,7 @@ sdump_addrinfo(struct addrinfo *ai, char
if (ai->ai_next != NULL) {
written = snprintf(buffer, buflen, ":");
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319033 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:03:06 2017
New Revision: 319033
URL: https://svnweb.freebsd.org/changeset/base/319033

Log:
  getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getserv_test.c

Modified: head/lib/libc/tests/nss/getserv_test.c
==
--- head/lib/libc/tests/nss/getserv_test.c  Sun May 28 03:59:33 2017
(r319032)
+++ head/lib/libc/tests/nss/getserv_test.c  Sun May 28 04:03:06 2017
(r319033)
@@ -177,16 +177,16 @@ sdump_servent(struct servent *serv, char
written = snprintf(buffer, buflen, "%s %d %s",
serv->s_name, ntohs(serv->s_port), serv->s_proto);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
if (serv->s_aliases != NULL) {
if (*(serv->s_aliases) != '\0') {
for (cp = serv->s_aliases; *cp; ++cp) {
-   written = snprintf(buffer, buflen, " %s",*cp);
+   written = snprintf(buffer, buflen, " %s", *cp);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
@@ -410,7 +410,7 @@ servent_test_getservent(struct servent *
return (servent_test_correctness(serv, NULL));
 }
 
-int
+static int
 run_tests(const char *snapshot_file, enum test_methods method)
 {
struct servent_test_data td, td_snap, td_2pass;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319035 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:04:32 2017
New Revision: 319035
URL: https://svnweb.freebsd.org/changeset/base/319035

Log:
  getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getrpc_test.c

Modified: head/lib/libc/tests/nss/getrpc_test.c
==
--- head/lib/libc/tests/nss/getrpc_test.c   Sun May 28 04:03:45 2017
(r319034)
+++ head/lib/libc/tests/nss/getrpc_test.c   Sun May 28 04:04:32 2017
(r319035)
@@ -173,16 +173,16 @@ sdump_rpcent(struct rpcent *rpc, char *b
written = snprintf(buffer, buflen, "%s %d",
rpc->r_name, rpc->r_number);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
if (rpc->r_aliases != NULL) {
if (*(rpc->r_aliases) != '\0') {
for (cp = rpc->r_aliases; *cp; ++cp) {
-   written = snprintf(buffer, buflen, " %s",*cp);
+   written = snprintf(buffer, buflen, " %s", *cp);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
@@ -400,7 +400,7 @@ rpcent_test_getrpcent(struct rpcent *rpc
return (rpcent_test_correctness(rpc, NULL));
 }
 
-int
+static int
 run_tests(const char *snapshot_file, enum test_methods method)
 {
struct rpcent_test_data td, td_snap, td_2pass;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319036 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:05:19 2017
New Revision: 319036
URL: https://svnweb.freebsd.org/changeset/base/319036

Log:
  getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getproto_test.c

Modified: head/lib/libc/tests/nss/getproto_test.c
==
--- head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:04:32 2017
(r319035)
+++ head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:05:19 2017
(r319036)
@@ -172,16 +172,16 @@ sdump_protoent(struct protoent *pe, char
written = snprintf(buffer, buflen, "%s %d",
pe->p_name, pe->p_proto);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
if (pe->p_aliases != NULL) {
if (*(pe->p_aliases) != '\0') {
for (cp = pe->p_aliases; *cp; ++cp) {
-   written = snprintf(buffer, buflen, " %s",*cp);
+   written = snprintf(buffer, buflen, " %s", *cp);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
@@ -395,7 +395,7 @@ protoent_test_getprotoent(struct protoen
return (protoent_test_correctness(pe, NULL));
 }
 
-int
+static int
 run_tests(const char *snapshot_file, enum test_methods method)
 {
struct protoent_test_data td, td_snap, td_2pass;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319037 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:11:04 2017
New Revision: 319037
URL: https://svnweb.freebsd.org/changeset/base/319037

Log:
  getaddrinfo_test: mark unused function parameters __unused to fix -Wunused
  warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getaddrinfo_test.c

Modified: head/lib/libc/tests/nss/getaddrinfo_test.c
==
--- head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 04:05:19 2017
(r319036)
+++ head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 04:11:04 2017
(r319037)
@@ -28,7 +28,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -125,7 +125,8 @@ compare_addrinfo_(struct addrinfo *ai1, 
 }
 
 static int
-compare_addrinfo(struct addrinfo *ai1, struct addrinfo *ai2, void *mdata)
+compare_addrinfo(struct addrinfo *ai1, struct addrinfo *ai2,
+void *mdata __unused)
 {
int rv;
 
@@ -344,7 +345,7 @@ addrinfo_read_snapshot_func(struct addri
 }
 
 static int
-addrinfo_test_correctness(struct addrinfo *ai, void *mdata)
+addrinfo_test_correctness(struct addrinfo *ai, void *mdata __unused)
 {
 
printf("testing correctness with the following data:\n");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319038 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:12:02 2017
New Revision: 319038
URL: https://svnweb.freebsd.org/changeset/base/319038

Log:
  getusershell_test: mark mdata parameter in compare_usershell __unused
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getusershell_test.c

Modified: head/lib/libc/tests/nss/getusershell_test.c
==
--- head/lib/libc/tests/nss/getusershell_test.c Sun May 28 04:11:04 2017
(r319037)
+++ head/lib/libc/tests/nss/getusershell_test.c Sun May 28 04:12:02 2017
(r319038)
@@ -76,7 +76,8 @@ clone_usershell(struct usershell *dest, 
 }
 
 static int
-compare_usershell(struct usershell *us1, struct usershell *us2, void *mdata)
+compare_usershell(struct usershell *us1, struct usershell *us2,
+void *mdata __unused)
 {
int rv;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319039 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:12:52 2017
New Revision: 319039
URL: https://svnweb.freebsd.org/changeset/base/319039

Log:
  getserv_test: mark unused parameters __unused to fix corresponding
  warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getserv_test.c

Modified: head/lib/libc/tests/nss/getserv_test.c
==
--- head/lib/libc/tests/nss/getserv_test.c  Sun May 28 04:12:02 2017
(r319038)
+++ head/lib/libc/tests/nss/getserv_test.c  Sun May 28 04:12:52 2017
(r319039)
@@ -300,7 +300,7 @@ servent_fill_test_data(struct servent_te
 }
 
 static int
-servent_test_correctness(struct servent *serv, void *mdata)
+servent_test_correctness(struct servent *serv, void *mdata __unused)
 {
printf("testing correctness with the following data:\n");
dump_servent(serv);
@@ -403,7 +403,7 @@ servent_test_getservbyport(struct serven
 }
 
 static int
-servent_test_getservent(struct servent *serv, void *mdata)
+servent_test_getservent(struct servent *serv, void *mdata __unused)
 {
/* Only correctness can be checked when doing 1-pass test for
 * getservent(). */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319040 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:15:05 2017
New Revision: 319040
URL: https://svnweb.freebsd.org/changeset/base/319040

Log:
  getrpc_test: fix -Wunused warnings
  
  - Mark unused function parameters unused.
  - Remove an unused function prototype.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getrpc_test.c

Modified: head/lib/libc/tests/nss/getrpc_test.c
==
--- head/lib/libc/tests/nss/getrpc_test.c   Sun May 28 04:12:52 2017
(r319039)
+++ head/lib/libc/tests/nss/getrpc_test.c   Sun May 28 04:15:05 2017
(r319040)
@@ -70,8 +70,6 @@ static int rpcent_test_getrpcbyname(stru
 static int rpcent_test_getrpcbynumber(struct rpcent *, void *);
 static int rpcent_test_getrpcent(struct rpcent *, void *);
 
-static void usage(void)  __attribute__((__noreturn__));
-
 IMPLEMENT_TEST_DATA(rpcent)
 IMPLEMENT_TEST_FILE_SNAPSHOT(rpcent)
 IMPLEMENT_1PASS_TEST(rpcent)
@@ -289,7 +287,7 @@ rpcent_fill_test_data(struct rpcent_test
 }
 
 static int
-rpcent_test_correctness(struct rpcent *rpc, void *mdata)
+rpcent_test_correctness(struct rpcent *rpc, void *mdata __unused)
 {
 
printf("testing correctness with the following data:\n");
@@ -390,7 +388,7 @@ rpcent_test_getrpcbynumber(struct rpcent
 }
 
 static int
-rpcent_test_getrpcent(struct rpcent *rpc, void *mdata)
+rpcent_test_getrpcent(struct rpcent *rpc, void *mdata __unused)
 {
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319041 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:15:57 2017
New Revision: 319041
URL: https://svnweb.freebsd.org/changeset/base/319041

Log:
  getproto_test: fix -Wunused warnings
  
  Mark unused parameters __unused in functions.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getproto_test.c

Modified: head/lib/libc/tests/nss/getproto_test.c
==
--- head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:15:05 2017
(r319040)
+++ head/lib/libc/tests/nss/getproto_test.c Sun May 28 04:15:57 2017
(r319041)
@@ -288,7 +288,7 @@ protoent_fill_test_data(struct protoent_
 }
 
 static int
-protoent_test_correctness(struct protoent *pe, void *mdata)
+protoent_test_correctness(struct protoent *pe, void *mdata __unused)
 {
printf("testing correctness with the following data:\n");
dump_protoent(pe);
@@ -388,7 +388,7 @@ protoent_test_getprotobynumber(struct pr
 }
 
 static int
-protoent_test_getprotoent(struct protoent *pe, void *mdata)
+protoent_test_getprotoent(struct protoent *pe, void *mdata __unused)
 {
/* Only correctness can be checked when doing 1-pass test for
 * getprotoent(). */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319042 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:34:57 2017
New Revision: 319042
URL: https://svnweb.freebsd.org/changeset/base/319042

Log:
  gethostby_test: fix multiple warning types
  
  - Fix -Wmissing-declaration warning by staticizing run_tests.
  - Fix -Wsign-compare warnings by casting size_t types to int
for comparisons.
  
  Reindent some of the code in sdump_hostent(..) to accomodate the
  overall changes.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/gethostby_test.c

Modified: head/lib/libc/tests/nss/gethostby_test.c
==
--- head/lib/libc/tests/nss/gethostby_test.cSun May 28 04:15:57 2017
(r319041)
+++ head/lib/libc/tests/nss/gethostby_test.cSun May 28 04:34:57 2017
(r319042)
@@ -412,7 +412,7 @@ sdump_hostent(struct hostent *ht, char *
written = snprintf(buffer, buflen, "%s %d %d",
ht->h_name, ht->h_addrtype, ht->h_length);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
@@ -421,7 +421,7 @@ sdump_hostent(struct hostent *ht, char *
for (cp = ht->h_aliases; *cp; ++cp) {
written = snprintf(buffer, buflen, " %s",*cp);
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
@@ -431,59 +431,61 @@ sdump_hostent(struct hostent *ht, char *
} else {
written = snprintf(buffer, buflen, " noaliases");
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
}
} else {
written = snprintf(buffer, buflen, " (null)");
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
}
 
written = snprintf(buffer, buflen, " : ");
buffer += written;
-   if (written > buflen)
+   if (written > (int)buflen)
return;
buflen -= written;
 
if (ht->h_addr_list != NULL) {
if (*(ht->h_addr_list) != NULL) {
for (cp = ht->h_addr_list; *cp; ++cp) {
-   for (i = 0; i < ht->h_length; ++i ) {
-   written = snprintf(buffer, buflen,
-   i + 1 != ht->h_length ? "%d." : "%d",
-   (unsigned char)(*cp)[i]);
-   buffer += written;
-   if (written > buflen)
-   return;
-   buflen -= written;
+   for (i = 0; i < (size_t)ht->h_length; ++i) {
+   written = snprintf(buffer, buflen,
+   i + 1 != (size_t)ht->h_length ?
+   "%d." : "%d",
+   (unsigned char)(*cp)[i]);
+   buffer += written;
+   if (written > (int)buflen)
+   return;
+   buflen -= written;
 
-   if (buflen == 0)
-   return;
-   }
+   if (buflen == 0)
+   return;
+   }
 
-   if (*(cp + 1) ) {
-   written = snprintf(buffer, buflen, " ");
-   buffer += written;
-   if (written > buflen)
-   return;
-   buflen -= written;
-   }
+   if (*(cp + 1)) {
+   written = snprintf(buffer, buflen,
+   " ");
+   buffer += written;
+   if (written > (int)buflen)
+   return;
+   buflen -= written;
+   }
}
} else {
written = snprintf(buffer, buflen, " noaddrs");
buffer += written;
-   if

svn commit: r319043 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:41:06 2017
New Revision: 319043
URL: https://svnweb.freebsd.org/changeset/base/319043

Log:
  getpw_test: fix -Wunused warnings
  
  - Mark unused parameters __unused.
  - Put dump_passwd under DEBUG as it's only used in that case.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getpw_test.c

Modified: head/lib/libc/tests/nss/getpw_test.c
==
--- head/lib/libc/tests/nss/getpw_test.cSun May 28 04:34:57 2017
(r319042)
+++ head/lib/libc/tests/nss/getpw_test.cSun May 28 04:41:06 2017
(r319043)
@@ -57,7 +57,9 @@ static int compare_passwd(struct passwd 
 static void free_passwd(struct passwd *);
 
 static void sdump_passwd(struct passwd *, char *, size_t);
+#ifdef DEBUG
 static void dump_passwd(struct passwd *);
+#endif
 
 static int passwd_read_snapshot_func(struct passwd *, char *);
 
@@ -95,7 +97,7 @@ clone_passwd(struct passwd *dest, struct
 }
 
 static int
-compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata)
+compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata __unused)
 {
ATF_REQUIRE(pwd1 != NULL);
ATF_REQUIRE(pwd2 != NULL);
@@ -140,6 +142,7 @@ sdump_passwd(struct passwd *pwd, char *b
pwd->pw_fields);
 }
 
+#ifdef DEBUG
 static void
 dump_passwd(struct passwd *pwd)
 {
@@ -150,6 +153,7 @@ dump_passwd(struct passwd *pwd)
} else
printf("(null)\n");
 }
+#endif
 
 static int
 passwd_read_snapshot_func(struct passwd *pwd, char *line)
@@ -249,7 +253,7 @@ passwd_fill_test_data(struct passwd_test
 }
 
 static int
-passwd_test_correctness(struct passwd *pwd, void *mdata)
+passwd_test_correctness(struct passwd *pwd, void *mdata __unused)
 {
 
 #ifdef DEBUG
@@ -361,7 +365,7 @@ passwd_test_getpwuid(struct passwd *pwd_
 }
 
 static int
-passwd_test_getpwent(struct passwd *pwd, void *mdata)
+passwd_test_getpwent(struct passwd *pwd, void *mdata __unused)
 {
/* Only correctness can be checked when doing 1-pass test for
 * getpwent(). */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319044 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 04:43:02 2017
New Revision: 319044
URL: https://svnweb.freebsd.org/changeset/base/319044

Log:
  getgr_test: fix -Wunused warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getgr_test.c

Modified: head/lib/libc/tests/nss/getgr_test.c
==
--- head/lib/libc/tests/nss/getgr_test.cSun May 28 04:41:06 2017
(r319043)
+++ head/lib/libc/tests/nss/getgr_test.cSun May 28 04:43:02 2017
(r319044)
@@ -307,7 +307,7 @@ group_fill_test_data(struct group_test_d
 }
 
 static int
-group_test_correctness(struct group *grp, void *mdata)
+group_test_correctness(struct group *grp, void *mdata __unused)
 {
printf("testing correctness with the following data:\n");
dump_group(grp);
@@ -385,7 +385,7 @@ group_test_getgrgid(struct group *grp_mo
 }
 
 static int
-group_test_getgrent(struct group *grp, void *mdata)
+group_test_getgrent(struct group *grp, void *mdata __unused)
 {
/* Only correctness can be checked when doing 1-pass test for
 * getgrent(). */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319045 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 05:26:45 2017
New Revision: 319045
URL: https://svnweb.freebsd.org/changeset/base/319045

Log:
  Fix -Wunused and -Wshadow warnings
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/gethostby_test.c

Modified: head/lib/libc/tests/nss/gethostby_test.c
==
--- head/lib/libc/tests/nss/gethostby_test.cSun May 28 04:43:02 2017
(r319044)
+++ head/lib/libc/tests/nss/gethostby_test.cSun May 28 05:26:45 2017
(r319045)
@@ -87,8 +87,6 @@ static int hostent_test_gethostbyaddr(st
 static int hostent_test_getaddrinfo_eq(struct hostent *, void *);
 static int hostent_test_getnameinfo_eq(struct hostent *, void *);
 
-static void usage(void)  __attribute__((__noreturn__));
-
 IMPLEMENT_TEST_DATA(hostent)
 IMPLEMENT_TEST_FILE_SNAPSHOT(hostent)
 IMPLEMENT_1PASS_TEST(hostent)
@@ -677,7 +675,7 @@ dump_hostent(struct hostent *result)
 }
 
 static int
-hostent_test_correctness(struct hostent *ht, void *mdata)
+hostent_test_correctness(struct hostent *ht, void *mdata __unused)
 {
 
 #ifdef DEBUG
@@ -760,7 +758,7 @@ hostent_test_gethostbyaddr(struct hosten
 }
 
 static int
-hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata)
+hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata __unused)
 {
struct addrinfo *ai, hints;
int rv;
@@ -799,7 +797,7 @@ hostent_test_getaddrinfo_eq(struct hoste
 }
 
 static int
-hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
+hostent_test_getnameinfo_eq(struct hostent *he, void *mdata __unused)
 {
char **cp;
char buffer[NI_MAXHOST];
@@ -923,14 +921,14 @@ hostent_test_getnameinfo_eq(struct hoste
 }
 
 static int
-run_tests(const char *hostlist_file, const char *snapshot_file, int af_type,
+run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type,
 enum test_methods method, bool use_ipv6_mapping)
 {
struct hostent_test_data td, td_addr, td_snap;
res_state statp;
int rv = -2;
 
-   switch (af_type) {
+   switch (_af_type) {
case AF_INET:
ATF_REQUIRE_FEATURE("inet");
ATF_REQUIRE(!use_ipv6_mapping);
@@ -939,7 +937,7 @@ run_tests(const char *hostlist_file, con
ATF_REQUIRE_FEATURE("inet6");
break;
default:
-   atf_tc_fail("unhandled address family: %d", af_type);
+   atf_tc_fail("unhandled address family: %d", _af_type);
break;
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319046 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 05:31:18 2017
New Revision: 319046
URL: https://svnweb.freebsd.org/changeset/base/319046

Log:
  Fix a -Wunused-but-set-variable warning reported by gcc 6.3.0
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getaddrinfo_test.c

Modified: head/lib/libc/tests/nss/getaddrinfo_test.c
==
--- head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 05:26:45 2017
(r319045)
+++ head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 05:31:18 2017
(r319046)
@@ -310,12 +310,11 @@ addrinfo_read_snapshot_func(struct addri
 {
struct addrinfo *ai2;
char *s, *ps;
-   int i, rv;
+   int rv;
 
printf("1 line read from snapshot:\n%s\n", line);
 
rv = 0;
-   i = 0;
ps = line;
 
s = strsep(&ps, ":");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319048 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 06:26:43 2017
New Revision: 319048
URL: https://svnweb.freebsd.org/changeset/base/319048

Log:
  Push `snapshot_file` copying down into run_tests function, and mark 
snapshot_file
  const char *.
  
  This fixes a bogus set of errors from gcc about strdup not being allowed a 
NULL
  argument.
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/getaddrinfo_test.c
  head/lib/libc/tests/nss/gethostby_test.c

Modified: head/lib/libc/tests/nss/getaddrinfo_test.c
==
--- head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 06:13:38 2017
(r319047)
+++ head/lib/libc/tests/nss/getaddrinfo_test.c  Sun May 28 06:26:43 2017
(r319048)
@@ -410,11 +410,19 @@ addrinfo_read_hostlist_func(struct addri
 }
 
 static void
-run_tests(char *hostlist_file, char *snapshot_file, int ai_family)
+run_tests(char *hostlist_file, const char *snapshot_file, int ai_family)
 {
struct addrinfo_test_data td, td_snap;
+   char *snapshot_file_copy;
int rv;
 
+   if (snapshot_file == NULL)
+   snapshot_file_copy = NULL;
+   else {
+   snapshot_file_copy = strdup(snapshot_file);
+   ATF_REQUIRE(snapshot_file_copy != NULL);
+   }
+
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = ai_family;
hints.ai_flags = AI_CANONNAME;
@@ -477,24 +485,17 @@ fin:
TEST_DATA_DESTROY(addrinfo, &td_snap);
TEST_DATA_DESTROY(addrinfo, &td);
 
-   free(hostlist_file);
-   free(snapshot_file);
+   free(snapshot_file_copy);
 }
 
 #defineHOSTLIST_FILE   "mach"
 #defineRUN_TESTS(tc, snapshot_file, ai_family) do {
\
char *_hostlist_file;   \
-   char *_snapshot_file;   \
ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s",  \
atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE));   \
-   if (snapshot_file == NULL)  \
-   _snapshot_file = NULL;  \
-   else {  \
-   _snapshot_file = strdup(snapshot_file); \
-   ATF_REQUIRE(_snapshot_file != NULL);\
-   }   \
-   run_tests(_hostlist_file, _snapshot_file, ai_family);   \
-} while(0)
+   run_tests(_hostlist_file, snapshot_file, ai_family);\
+   free(_hostlist_file);   \
+} while (0)
 
 ATF_TC_WITHOUT_HEAD(pf_unspec);
 ATF_TC_BODY(pf_unspec, tc)

Modified: head/lib/libc/tests/nss/gethostby_test.c
==
--- head/lib/libc/tests/nss/gethostby_test.cSun May 28 06:13:38 2017
(r319047)
+++ head/lib/libc/tests/nss/gethostby_test.cSun May 28 06:26:43 2017
(r319048)
@@ -924,10 +924,19 @@ static int
 run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type,
 enum test_methods method, bool use_ipv6_mapping)
 {
+   char *snapshot_file_copy;
struct hostent_test_data td, td_addr, td_snap;
res_state statp;
int rv = -2;
 
+   if (snapshot_file == NULL)
+   snapshot_file_copy = NULL;
+   else {
+   snapshot_file_copy = strdup(snapshot_file);
+   ATF_REQUIRE(snapshot_file_copy != NULL);
+   }
+   snapshot_file = snapshot_file_copy;
+
switch (_af_type) {
case AF_INET:
ATF_REQUIRE_FEATURE("inet");
@@ -946,8 +955,8 @@ run_tests(const char *hostlist_file, con
if (statp == NULL || ((statp->options & RES_INIT) == 0 &&
res_ninit(statp) == -1)) {
printf("error: can't init res_state\n");
-
-   return (-1);
+   rv = -1;
+   goto fin2;
}
 
if (use_ipv6_mapping)
@@ -1051,6 +1060,9 @@ fin:
TEST_DATA_DESTROY(hostent, &td_addr);
TEST_DATA_DESTROY(hostent, &td);
 
+fin2:
+   free(snapshot_file_copy);
+
return (rv);
 }
 
@@ -1059,30 +1071,24 @@ fin:
 #define_RUN_TESTS(tc, snapshot_file, af_type, method, 
use_ipv6_mapping) \
 do {   \
char *_hostlist_file;   \
-   char *_snapshot_file;   \
ATF_REQUIRE(0 < asprintf(&_hostlist_file, "%s/%s",  \
atf_tc_get_config_var(tc, "srcdir"), HOSTLIST_FILE));   \
-   if (snapshot_file == NULL)  \
-  

svn commit: r319049 - head/lib/libc/tests/nss

2017-05-27 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 06:29:01 2017
New Revision: 319049
URL: https://svnweb.freebsd.org/changeset/base/319049

Log:
  Bump WARNS from 1 to 3 after recent commits to fix warnings in the
  directory.
  
  Tested with:  clang 4.0, gcc 4.2.1, gcc 6.3.0
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/Makefile

Modified: head/lib/libc/tests/nss/Makefile
==
--- head/lib/libc/tests/nss/MakefileSun May 28 06:26:43 2017
(r319048)
+++ head/lib/libc/tests/nss/MakefileSun May 28 06:29:01 2017
(r319049)
@@ -20,7 +20,7 @@ ATF_TESTS_C+= getusershell_test
 
 ${PACKAGE}FILES+=  mach
 
-WARNS?=1
+WARNS?=3
 
 CFLAGS+=   -I${SRCTOP}/tests
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319051 - head/lib/libc/tests/nss

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 07:04:50 2017
New Revision: 319051
URL: https://svnweb.freebsd.org/changeset/base/319051

Log:
  hostent_test_getnameinfo_eq(..): initialize found_a_host to false
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1368943
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/gethostby_test.c

Modified: head/lib/libc/tests/nss/gethostby_test.c
==
--- head/lib/libc/tests/nss/gethostby_test.cSun May 28 06:31:52 2017
(r319050)
+++ head/lib/libc/tests/nss/gethostby_test.cSun May 28 07:04:50 2017
(r319051)
@@ -884,7 +884,7 @@ hostent_test_getnameinfo_eq(struct hoste
 * An address might reverse resolve to hostname alias or the
 * official hostname, e.g. moon.vub.ac.be.
 */
-   bool found_a_match;
+   bool found_a_match = false;
 
if (strcmp(result->h_name, buffer) == 0) {
found_a_match = true;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319054 - head/lib/libc/tests/nss

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 07:40:42 2017
New Revision: 319054
URL: https://svnweb.freebsd.org/changeset/base/319054

Log:
  hostent_test_getaddrinfo_eq(..): call freeaddrinfo on `ai` when done
  
  This plugs a leak of memory allocated via getaddrinfo.
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1346866
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libc/tests/nss/gethostby_test.c

Modified: head/lib/libc/tests/nss/gethostby_test.c
==
--- head/lib/libc/tests/nss/gethostby_test.cSun May 28 07:40:09 2017
(r319053)
+++ head/lib/libc/tests/nss/gethostby_test.cSun May 28 07:40:42 2017
(r319054)
@@ -776,24 +776,26 @@ hostent_test_getaddrinfo_eq(struct hoste
rv = getaddrinfo(he->h_name, NULL, &hints, &ai);
if (rv == 0) {
printf("not ok - shouldn't have been resolved\n");
-   return (-1);
-   }
+   rv = -1;
+   } else
+   rv = 0;
} else {
rv = getaddrinfo(he->h_name, NULL, &hints, &ai);
if (rv != 0) {
printf("not ok - should have been resolved\n");
-   return (-1);
+   rv = -1;
+   goto done;
}
-
rv = is_hostent_equal(he, ai);
if (rv != 0) {
printf("not ok - addrinfo and hostent are not equal\n");
-   return (-1);
+   rv = -1;
}
-
}
-
-   return (0);
+done:
+   if (ai != NULL)
+   freeaddrinfo(ai);
+   return (rv);
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319056 - head/tests/sys/file

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 08:46:41 2017
New Revision: 319056
URL: https://svnweb.freebsd.org/changeset/base/319056

Log:
  tests/sys/file/ftruncate_test: use an exit code of 1 instead
  of -1 with err*(3).
  
  An exit code of -1 is implementation defined -- it's best to stick
  with something well-defined (1).
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/file/ftruncate_test.c

Modified: head/tests/sys/file/ftruncate_test.c
==
--- head/tests/sys/file/ftruncate_test.cSun May 28 07:44:55 2017
(r319055)
+++ head/tests/sys/file/ftruncate_test.cSun May 28 08:46:41 2017
(r319056)
@@ -78,34 +78,34 @@ main(void)
snprintf(path, PATH_MAX, "/tmp/ftruncate.X");
fd = mkstemp(path);
if (fd < 0)
-   err(-1, "mkstemp");
+   err(1, "mkstemp");
read_only_fd = open(path, O_RDONLY);
if (read_only_fd < 0) {
error = errno;
(void)unlink(path);
errno = error;
-   err(-1, "open(%s, O_RDONLY)", path);
+   err(1, "open(%s, O_RDONLY)", path);
}
(void)unlink(path);
 
if (ftruncate(fd, -1) == 0)
-   errx(-1, "ftruncate(fd, -1) succeeded");
+   errx(1, "ftruncate(fd, -1) succeeded unexpectedly");
if (errno != EINVAL)
-   err(-1, "ftruncate(fd, -1) returned wrong error");
+   err(1, "ftruncate(fd, -1) returned wrong error");
 
for (i = 0; i < lengths_count; i++) {
len = lengths[i];
if (ftruncate(fd, len) < 0)
-   err(-1, "ftruncate(%jd) up", (intmax_t)len);
+   err(1, "ftruncate(%jd) up", (intmax_t)len);
if (fstat(fd, &sb) < 0)
-   err(-1, "stat");
+   err(1, "stat");
if (sb.st_size != len)
errx(-1, "fstat with len=%jd returned len %jd up",
(intmax_t)len, (intmax_t)sb.st_size);
if (len != 0) {
size = pread(fd, &ch, sizeof(ch), len - 1);
if (size < 0)
-   err(-1, "pread on len %jd up", (intmax_t)len);
+   err(1, "pread on len %jd up", (intmax_t)len);
if (size != sizeof(ch))
errx(-1, "pread len %jd size %jd up",
(intmax_t)len, (intmax_t)size);
@@ -119,9 +119,9 @@ main(void)
for (i = lengths_count - 1; i >= 0; i--) {
len = lengths[i];
if (ftruncate(fd, len) < 0)
-   err(-1, "ftruncate(%jd) down", (intmax_t)len);
+   err(1, "ftruncate(%jd) down", (intmax_t)len);
if (fstat(fd, &sb) < 0)
-   err(-1, "stat");
+   err(1, "stat");
if (sb.st_size != len)
errx(-1, "fstat(%jd) returned %jd down", (intmax_t)len,
sb.st_size);
@@ -134,7 +134,7 @@ main(void)
if (ftruncate(read_only_fd, 0) == 0)
errx(-1, "ftruncate(read_only_fd) succeeded");
if (errno != EINVAL)
-   err(-1, "ftruncate(read_only_fd) returned wrong error");
+   err(1, "ftruncate(read_only_fd) returned wrong error");
close(read_only_fd);
 
/*
@@ -142,22 +142,22 @@ main(void)
 */
fd = socket(PF_UNIX, SOCK_STREAM, 0);
if (fd < 0)
-   err(-1, "socket(PF_UNIX, SOCK_STREAM, 0)");
+   err(1, "socket(PF_UNIX, SOCK_STREAM, 0)");
if (ftruncate(fd, 0) == 0)
errx(-1, "ftruncate(socket) succeeded");
if (errno != EINVAL)
-   err(-1, "ftruncate(socket) returned wrong error");
+   err(1, "ftruncate(socket) returned wrong error");
close(fd);
 
/*
 * Make sure that ftruncate on pipes doesn't work.
 */
if (pipe(fds) < 0)
-   err(-1, "pipe");
+   err(1, "pipe");
if (ftruncate(fds[0], 0) == 0)
errx(-1, "ftruncate(pipe) succeeded");
if (errno != EINVAL)
-   err(-1, "ftruncate(pipe) returned wrong error");
+   err(1, "ftruncate(pipe) returned wrong error");
close(fds[0]);
close(fds[1]);
 
@@ -166,11 +166,11 @@ main(void)
 */
fd = kqueue();
if (fd < 0)
-   err(-1, "kqueue");
+   err(1, "kqueue");
if (ftruncate(fds[0], 0) == 0)
errx(-1, "ftruncate(kqueue) succeeded");
if (errno != EINVAL)
-   err(-1, "ftruncate(kqueue) returned wrong error");
+   err(1, "ftruncate(kqueue) returned wrong error");
close(fd);
 

svn commit: r319058 - head/tests/sys/file

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 08:52:12 2017
New Revision: 319058
URL: https://svnweb.freebsd.org/changeset/base/319058

Log:
  Create a deterministic file in the kyua sandbox, instead of a
  temporary file outside the kyua sandbox
  
  This helps ensure that the file is removed at test exit, and as
  a side effect, cures a warning about umasks with Coverity.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/file/ftruncate_test.c

Modified: head/tests/sys/file/ftruncate_test.c
==
--- head/tests/sys/file/ftruncate_test.cSun May 28 08:46:57 2017
(r319057)
+++ head/tests/sys/file/ftruncate_test.cSun May 28 08:52:12 2017
(r319058)
@@ -60,14 +60,14 @@ int
 main(void)
 {
int error, fd, fds[2], i, read_only_fd;
-   char path[PATH_MAX];
+   char path[] = "ftruncate_file";
struct stat sb;
ssize_t size;
off_t len;
char ch;
 
/*
-* Tests using a writable temporary file: grow and then shrink a file
+* Tests using a writable file: grow and then shrink a file
 * using ftruncate and various lengths.  Make sure that a negative
 * file length is rejected.  Make sure that when we grow the file,
 * bytes now in the range of the file size return 0.
@@ -75,10 +75,9 @@ main(void)
 * Save a read-only reference to the file to use later for read-only
 * descriptor tests.
 */
-   snprintf(path, PATH_MAX, "/tmp/ftruncate.X");
-   fd = mkstemp(path);
+   fd = open(path, O_RDWR|O_CREAT);
if (fd < 0)
-   err(1, "mkstemp");
+   err(1, "open(%s, O_RDWR|O_CREAT", path);
read_only_fd = open(path, O_RDONLY);
if (read_only_fd < 0) {
error = errno;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319059 - head/tests/sys/file

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 08:55:32 2017
New Revision: 319059
URL: https://svnweb.freebsd.org/changeset/base/319059

Log:
  Use an exit code of 1 instead of -1 for reasons noted in r319056
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/file/newfileops_on_fork_test.c

Modified: head/tests/sys/file/newfileops_on_fork_test.c
==
--- head/tests/sys/file/newfileops_on_fork_test.c   Sun May 28 08:52:12 
2017(r319058)
+++ head/tests/sys/file/newfileops_on_fork_test.c   Sun May 28 08:55:32 
2017(r319059)
@@ -61,7 +61,7 @@ do_accept(__unused void *arg)
 
accept_fd = accept(listen_fd, NULL, NULL);
if (accept_fd < 0)
-   err(-1, "accept");
+   err(1, "accept");
 
return (NULL);
 }
@@ -73,7 +73,7 @@ do_fork(void)
 
pid = fork();
if (pid < 0)
-   err(-1, "fork");
+   err(1, "fork");
if (pid > 0) {
waitpid(pid, NULL, 0);
exit(0);
@@ -84,15 +84,15 @@ do_fork(void)
 * listen_fd+1, and get back EBADF if it's not a valid descriptor,
 * and EINVAL if it is.  This (currently) works fine in practice.
 */
-   if (ftruncate(listen_fd + 1, 0 < 0)) {
+   if (ftruncate(listen_fd + 1, 0) < 0) {
if (errno == EBADF)
exit(0);
else if (errno == EINVAL)
-   errx(-1, "file descriptor still open in child");
+   errx(1, "file descriptor still open in child");
else
-   err(-1, "unexpected error");
+   err(1, "unexpected error");
} else
-   errx(-1, "ftruncate succeeded");
+   errx(1, "ftruncate succeeded");
 }
 
 int
@@ -103,18 +103,18 @@ main(__unused int argc, __unused char *a
 
listen_fd = socket(PF_INET, SOCK_STREAM, 0);
if (listen_fd < 0)
-   err(-1, "socket");
+   err(1, "socket");
bzero(&sin, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
sin.sin_port = htons(PORT);
if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
-   err(-1, "bind");
+   err(1, "bind");
if (listen(listen_fd, -1) <0)
-   err(-1, "listen");
+   err(1, "listen");
if (pthread_create(&accept_thread, NULL, do_accept, NULL) != 0)
-   err(-1, "pthread_create");
+   err(1, "pthread_create");
sleep(1);   /* Easier than using a CV. */
do_fork();
exit(0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319060 - head/tests/sys/file

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 08:57:08 2017
New Revision: 319060
URL: https://svnweb.freebsd.org/changeset/base/319060

Log:
  Use main(void) instead of main(argc __unused, argv __unused)
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/file/newfileops_on_fork_test.c

Modified: head/tests/sys/file/newfileops_on_fork_test.c
==
--- head/tests/sys/file/newfileops_on_fork_test.c   Sun May 28 08:55:32 
2017(r319059)
+++ head/tests/sys/file/newfileops_on_fork_test.c   Sun May 28 08:57:08 
2017(r319060)
@@ -96,7 +96,7 @@ do_fork(void)
 }
 
 int
-main(__unused int argc, __unused char *argv[])
+main(void)
 {
struct sockaddr_in sin;
pthread_t accept_thread;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319061 - head/tests/sys/file

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 09:01:58 2017
New Revision: 319061
URL: https://svnweb.freebsd.org/changeset/base/319061

Log:
  Don't leak accept_fd on thread completion
  
  MFC after:3 days
  Reported by:  Coverity
  CID:  1296068
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/file/newfileops_on_fork_test.c

Modified: head/tests/sys/file/newfileops_on_fork_test.c
==
--- head/tests/sys/file/newfileops_on_fork_test.c   Sun May 28 08:57:08 
2017(r319060)
+++ head/tests/sys/file/newfileops_on_fork_test.c   Sun May 28 09:01:58 
2017(r319061)
@@ -63,6 +63,7 @@ do_accept(__unused void *arg)
if (accept_fd < 0)
err(1, "accept");
 
+   close(accept_fd);
return (NULL);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319062 - head/tests/sys/netinet

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 09:08:30 2017
New Revision: 319062
URL: https://svnweb.freebsd.org/changeset/base/319062

Log:
  Initial `srv` before using it in bind(2)
  
  MFC after:3 days
  Reported by:  Coverity
  CID:  1357526
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/netinet/tcp_user_cookie.c

Modified: head/tests/sys/netinet/tcp_user_cookie.c
==
--- head/tests/sys/netinet/tcp_user_cookie.cSun May 28 09:01:58 2017
(r319061)
+++ head/tests/sys/netinet/tcp_user_cookie.cSun May 28 09:08:30 2017
(r319062)
@@ -72,6 +72,7 @@ main(int argc, char **argv)
if (sock < 0)
err(EXIT_FAILURE, "socket");
 
+   memset(&srv, 0, sizeof(srv));
srv.sin_len = sizeof(srv);
srv.sin_family = AF_INET;
srv.sin_port = htons(port);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319063 - head/tests/sys/kern

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 09:21:28 2017
New Revision: 319063
URL: https://svnweb.freebsd.org/changeset/base/319063

Log:
  Send all of `data`, not just a portion of it
  
  It was sending only a long's worth (4 or 8 bytes) of data previously
  (instead of the entire buffer) via send(2).
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1229966, 1229967, 1230004, 1230005
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/kern/unix_seqpacket_test.c

Modified: head/tests/sys/kern/unix_seqpacket_test.c
==
--- head/tests/sys/kern/unix_seqpacket_test.c   Sun May 28 09:08:30 2017
(r319062)
+++ head/tests/sys/kern/unix_seqpacket_test.c   Sun May 28 09:21:28 2017
(r319063)
@@ -762,7 +762,7 @@ ATF_TC_BODY(shutdown_send, tc)
/* ATF's isolation mechanisms will guarantee uniqueness of this file */
const char *path = "sock";
const char *data = "data";
-   ssize_t ssize;
+   ssize_t datalen, ssize;
int s, err, s2;
 
s = socket(PF_LOCAL, SOCK_SEQPACKET, 0);
@@ -786,8 +786,9 @@ ATF_TC_BODY(shutdown_send, tc)
}
 
ATF_CHECK_EQ(0, shutdown(s2, SHUT_RDWR));
+   datalen = strlen(data) + 1; /* +1 for the null */
/* USE MSG_NOSIGNAL so we don't get SIGPIPE */
-   ssize = send(s2, data, sizeof(data), MSG_EOR | MSG_NOSIGNAL);
+   ssize = send(s2, data, datalen, MSG_EOR | MSG_NOSIGNAL);
ATF_CHECK_EQ(EPIPE, errno);
ATF_CHECK_EQ(-1, ssize);
close(s);
@@ -802,6 +803,7 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc)
/* ATF's isolation mechanisms will guarantee uniqueness of this file */
const char *path = "sock";
const char *data = "data";
+   ssize_t datalen;
int s, err, s2;
 
s = socket(PF_LOCAL, SOCK_SEQPACKET, 0);
@@ -826,7 +828,8 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc)
 
ATF_CHECK_EQ(0, shutdown(s2, SHUT_RDWR));
ATF_REQUIRE(SIG_ERR != signal(SIGPIPE, shutdown_send_sigpipe_handler));
-   (void)send(s2, data, sizeof(data), MSG_EOR);
+   datalen = strlen(data) + 1; /* +1 for the null */
+   (void)send(s2, data, sizeof(*data), MSG_EOR);
ATF_CHECK_EQ(1, got_sigpipe);
close(s);
close(s2);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319078 - head/tests/sys/file

2017-05-28 Thread Ngie Cooper
Author: ngie
Date: Sun May 28 17:50:29 2017
New Revision: 319078
URL: https://svnweb.freebsd.org/changeset/base/319078

Log:
  Tweak r319058 slightly
  
  - Specify an explicit mode when using O_CREAT per open(2).
  - Fix the error message (add missing enclosing parentheses).
  
  Submitted by: jilles
  MFC after:3 days
  MFC with: r319058
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/file/ftruncate_test.c

Modified: head/tests/sys/file/ftruncate_test.c
==
--- head/tests/sys/file/ftruncate_test.cSun May 28 17:48:54 2017
(r319077)
+++ head/tests/sys/file/ftruncate_test.cSun May 28 17:50:29 2017
(r319078)
@@ -75,9 +75,9 @@ main(void)
 * Save a read-only reference to the file to use later for read-only
 * descriptor tests.
 */
-   fd = open(path, O_RDWR|O_CREAT);
+   fd = open(path, O_RDWR|O_CREAT, 0600);
if (fd < 0)
-   err(1, "open(%s, O_RDWR|O_CREAT", path);
+   err(1, "open(%s, O_RDWR|O_CREAT, 0600)", path);
read_only_fd = open(path, O_RDONLY);
if (read_only_fd < 0) {
error = errno;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319155 - head/lib/libnv/tests

2017-05-29 Thread Ngie Cooper
Author: ngie
Date: Mon May 29 18:34:45 2017
New Revision: 319155
URL: https://svnweb.freebsd.org/changeset/base/319155

Log:
  lib/libnv/tests/dnv_test: fix memory leaks for memory allocated via
  either strdup or one of the dnvlist* libcalls.
  
  Reported by:  Coverity
  CID:  1362056-1362060
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libnv/tests/dnv_tests.cc

Modified: head/lib/libnv/tests/dnv_tests.cc
==
--- head/lib/libnv/tests/dnv_tests.cc   Mon May 29 18:20:29 2017
(r319154)
+++ head/lib/libnv/tests/dnv_tests.cc   Mon May 29 18:34:45 2017
(r319155)
@@ -391,6 +391,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_string__
ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0);
 
free(actual_val);
+   free(default_val);
nvlist_destroy(nvl);
 }
 
@@ -408,6 +409,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_string__
ATF_REQUIRE_EQ(strcmp(actual_val, default_val), 0);
 
free(actual_val);
+   free(default_val);
nvlist_destroy(nvl);
 }
 
@@ -496,6 +498,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__
 
free(actual_val);
free(default_val);
+   free(value);
nvlist_destroy(nvl);
 }
 
@@ -515,6 +518,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__
ATF_REQUIRE_EQ(memcmp(actual_val, default_val, actual_size), 0);
 
free(actual_val);
+   free(default_val);
nvlist_destroy(nvl);
 }
 
@@ -535,6 +539,7 @@ ATF_TEST_CASE_BODY(dnvlist_take_binary__
ATF_REQUIRE_EQ(memcmp(actual_val, default_val, default_size), 0);
 
free(actual_val);
+   free(default_val);
nvlist_destroy(nvl);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319156 - head/lib/libnv/tests

2017-05-29 Thread Ngie Cooper
Author: ngie
Date: Mon May 29 18:39:28 2017
New Revision: 319156
URL: https://svnweb.freebsd.org/changeset/base/319156

Log:
  :nvlist_unpack__duplicate_key : check the result of nvlist_pack(3)
  
  This fixes a potential NULL pointer dereference.
  
  MFC after:3 days
  Reported by:  Coverity
  CID:  1362051
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libnv/tests/nv_tests.cc

Modified: head/lib/libnv/tests/nv_tests.cc
==
--- head/lib/libnv/tests/nv_tests.ccMon May 29 18:34:45 2017
(r319155)
+++ head/lib/libnv/tests/nv_tests.ccMon May 29 18:39:28 2017
(r319156)
@@ -640,6 +640,7 @@ ATF_TEST_CASE_BODY(nvlist_unpack__duplic
nvlist_add_number(nvl, key2, 10);
 
packed = nvlist_pack(nvl, &size);
+   ATF_REQUIRE(packed != NULL);
 
/*
 * Mangle the packed nvlist by replacing key1 with key2, creating a
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319157 - head/lib/msun/tests

2017-05-29 Thread Ngie Cooper
Author: ngie
Date: Mon May 29 18:45:10 2017
New Revision: 319157
URL: https://svnweb.freebsd.org/changeset/base/319157

Log:
  fma_test: mute a warning about unreachable code on amd64 by restructuring
  the #ifdef block to only handle the rest of the logic in the loop in the
  #else case.
  
  MFC after:3 days
  Reported by:  Coverity
  CID:  1346844
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/msun/tests/fma_test.c

Modified: head/lib/msun/tests/fma_test.c
==
--- head/lib/msun/tests/fma_test.c  Mon May 29 18:39:28 2017
(r319156)
+++ head/lib/msun/tests/fma_test.c  Mon May 29 18:45:10 2017
(r319157)
@@ -498,11 +498,12 @@ main(void)
printf("ok %d # SKIP testcase fails assertion on "
"amd64\n", j);
continue;
-#endif
+#else
printf("rmode = %d\n", rmodes[i]);
fesetround(rmodes[i]);
test_infinities();
printf("ok %d - fma infinities\n", j);
+#endif
}
 
fesetround(FE_TONEAREST);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319158 - head/lib/msun/tests

2017-05-29 Thread Ngie Cooper
Author: ngie
Date: Mon May 29 18:49:28 2017
New Revision: 319158
URL: https://svnweb.freebsd.org/changeset/base/319158

Log:
  logarithm_test: assert that feclearexcept succeeds
  
  This helps ensure that test preconditons are fulfilled.
  
  MFC after:3 days
  Reported by:  Coverity
  CID:  1346572
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/msun/tests/logarithm_test.c

Modified: head/lib/msun/tests/logarithm_test.c
==
--- head/lib/msun/tests/logarithm_test.cMon May 29 18:45:10 2017
(r319157)
+++ head/lib/msun/tests/logarithm_test.cMon May 29 18:49:28 2017
(r319158)
@@ -137,7 +137,7 @@ run_log2_tests(void)
 * We should insist that log2() return exactly the correct
 * result and not raise an inexact exception for powers of 2.
 */
-   feclearexcept(FE_ALL_EXCEPT);
+   assert(feclearexcept(FE_ALL_EXCEPT) == 0);
for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) {
assert(log2f(ldexpf(1.0, i)) == i);
assert(fetestexcept(ALL_STD_EXCEPT) == 0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319159 - head/lib/libnv/tests

2017-05-29 Thread Ngie Cooper
Author: ngie
Date: Mon May 29 19:02:52 2017
New Revision: 319159
URL: https://svnweb.freebsd.org/changeset/base/319159

Log:
  :dnvlist_get_string__default_value: fix a bogus string comparison test
  
  Check actual_value vs "5", not "5" vs itself.
  
  MFC after:3 days
  Reported by:  Coverity
  CID:  1362021
  Sponsored by: Dell EMC Isilon

Modified:
  head/lib/libnv/tests/dnv_tests.cc

Modified: head/lib/libnv/tests/dnv_tests.cc
==
--- head/lib/libnv/tests/dnv_tests.cc   Mon May 29 18:49:28 2017
(r319158)
+++ head/lib/libnv/tests/dnv_tests.cc   Mon May 29 19:02:52 2017
(r319159)
@@ -150,7 +150,7 @@ ATF_TEST_CASE_BODY(dnvlist_get_string__d
 
ATF_REQUIRE_EQ(strcmp(dnvlist_get_string(nvl, "hthth", "fd"), "fd"), 0);
actual_value = dnvlist_get_string(nvl, "5", "5");
-   ATF_REQUIRE_EQ(strcmp("5", "5"), 0);
+   ATF_REQUIRE_EQ(strcmp(actual_value, "5"), 0);
 
nvlist_destroy(nvl);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319246 - head/tools/build/options

2017-05-30 Thread Ngie Cooper
Author: ngie
Date: Tue May 30 18:03:34 2017
New Revision: 319246
URL: https://svnweb.freebsd.org/changeset/base/319246

Log:
  Use .Xr to reference libblacklist(3), blacklistctl(8), and blacklistd(8)
  
  MFC after:now
  Sponsored by: Dell EMC Isilon

Modified:
  head/tools/build/options/WITHOUT_BLACKLIST
  head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT

Modified: head/tools/build/options/WITHOUT_BLACKLIST
==
--- head/tools/build/options/WITHOUT_BLACKLIST  Tue May 30 17:48:41 2017
(r319245)
+++ head/tools/build/options/WITHOUT_BLACKLIST  Tue May 30 18:03:34 2017
(r319246)
@@ -1,2 +1,5 @@
 .\" $FreeBSD$
-Set this if you do not want to build blacklistd/blacklistctl.
+Set this if you do not want to build
+.Xr blacklistd 8
+and
+.Xr blacklistctl 8 .

Modified: head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT
==
--- head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT  Tue May 30 17:48:41 
2017(r319245)
+++ head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT  Tue May 30 18:03:34 
2017(r319246)
@@ -1,5 +1,7 @@
 .\" $FreeBSD$
-Set to build some programs without blacklistd support, like
+Set to build some programs without
+.Xr libblacklist 3
+support, like
 .Xr fingerd 8 ,
 .Xr ftpd 8 ,
 .Xr rlogind 8 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319248 - head/share/man/man5

2017-05-30 Thread Ngie Cooper
Author: ngie
Date: Tue May 30 18:06:19 2017
New Revision: 319248
URL: https://svnweb.freebsd.org/changeset/base/319248

Log:
  Regenerate src.conf(5)
  
  This contains a number of content changes due to src.opts.mk changes.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue May 30 18:04:55 2017
(r319247)
+++ head/share/man/man5/src.conf.5  Tue May 30 18:06:19 2017
(r319248)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd April 21, 2017
+.Dd May 30, 2017
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -180,7 +180,10 @@ as part of the bootstrap process.
 This is a default setting on
 amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
 .It Va WITHOUT_BLACKLIST
-Set this if you do not want to build blacklistd/blacklistctl.
+Set this if you do not want to build
+.Xr blacklistd 8
+and
+.Xr blacklistctl 8 .
 When set, it enforces these options:
 .Pp
 .Bl -item -compact
@@ -188,7 +191,9 @@ When set, it enforces these options:
 .Va WITHOUT_BLACKLIST_SUPPORT
 .El
 .It Va WITHOUT_BLACKLIST_SUPPORT
-Set to build some programs without blacklistd support, like
+Set to build some programs without
+.Xr libblacklist 3
+support, like
 .Xr fingerd 8 ,
 .Xr ftpd 8 ,
 .Xr rlogind 8 ,
@@ -705,13 +710,34 @@ Set to not build
 .Xr gdb 1 .
 .Pp
 This is a default setting on
-amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, 
mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, 
riscv/riscv64 and riscv/riscv64sf.
+arm64/aarch64, riscv/riscv64 and riscv/riscv64sf.
 .It Va WITH_GDB
 Set to build
 .Xr gdb 1 .
 .Pp
 This is a default setting on
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
+.It Va WITHOUT_GDB_LIBEXEC
+Set to install
+.Xr gdb 1
+into
+.Pa /usr/bin .
+.Pp
+This is a default setting on
 arm/arm, arm/armeb, arm/armv6 and sparc64/sparc64.
+.It Va WITH_GDB_LIBEXEC
+Set to install
+.Xr gdb 1
+into
+.Pa /usr/libexec .
+This permits
+.Xr gdb 1
+to be used as a fallback for
+.Xr crashinfo 8
+if a newer version is not installed.
+.Pp
+This is a default setting on
+amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, 
mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, 
mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, 
riscv/riscv64 and riscv/riscv64sf.
 .It Va WITHOUT_GNUCXX
 Do not build the GNU C++ stack (g++, libstdc++).
 This is the default on platforms where clang is the system compiler.
@@ -943,12 +969,6 @@ Set to not build LLVM's lld linker.
 .Pp
 This is a default setting on
 mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, 
mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, 
powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and 
sparc64/sparc64.
-When set, it enforces these options:
-.Pp
-.Bl -item -compact
-.It
-.Va WITHOUT_LLD_IS_LD
-.El
 .It Va WITH_LLD
 Set to build LLVM's lld linker.
 .Pp
@@ -987,14 +1007,6 @@ Set to use LLVM's LLD as the system linker, instead of
 .Pp
 This is a default setting on
 arm64/aarch64.
-When set, these options are also in effect:
-.Pp
-.Bl -inset -compact
-.It Va WITHOUT_SYSTEM_COMPILER
-(unless
-.Va WITH_SYSTEM_COMPILER
-is set explicitly)
-.El
 .It Va WITHOUT_LLVM_LIBUNWIND
 Set to use GCC's stack unwinder (instead of LLVM's libunwind).
 .Pp
@@ -1412,24 +1424,6 @@ The
 and
 .Va WITHOUT_GCC
 options control those.
-.Pp
-This is a default setting on
-arm64/aarch64.
-.It Va WITH_SYSTEM_COMPILER
-Set to opportunistically skip building a cross-compiler during the
-bootstrap phase of the build.
-If the currently installed compiler matches the planned bootstrap compiler
-type and revision, then it will not be built.
-This does not prevent a compiler from being built for installation though,
-only for building one for the build itself.
-The
-.Va WITHOUT_CLANG
-and
-.Va WITHOUT_GCC
-options control those.
-.Pp
-This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
 .It Va WITHOUT_TALK
 Set to not build or install
 .

svn commit: r319293 - head/usr.bin/mkimg/tests

2017-05-31 Thread Ngie Cooper
Author: ngie
Date: Wed May 31 07:42:14 2017
New Revision: 319293
URL: https://svnweb.freebsd.org/changeset/base/319293

Log:
  Formalize the dependent/dependency relationship for .gz.uu vs 
  
  This helps ensure that the output files are regenerated if the input files
  change, after the output files have been created.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/mkimg/tests/Makefile

Modified: head/usr.bin/mkimg/tests/Makefile
==
--- head/usr.bin/mkimg/tests/Makefile   Wed May 31 06:47:56 2017
(r319292)
+++ head/usr.bin/mkimg/tests/Makefile   Wed May 31 07:42:14 2017
(r319293)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.PATH: ${.CURDIR}
+
 PACKAGE=   tests
 
 ATF_TESTS_SH=  mkimg_test
@@ -7,8 +9,10 @@ ATF_TESTS_SH=  mkimg_test
 SOURCES!=  cd ${.CURDIR}; echo *.uu
 ${PACKAGE}FILES+=  ${SOURCES:S,.gz.uu,,g}
 
-${${PACKAGE}FILES}:
-   uudecode -p ${.CURDIR}/${.TARGET}.gz.uu | gunzip -c > ${.TARGET}
+.for f in ${${PACKAGE}FILES}
+$f: $f.gz.uu
+   uudecode -p ${.ALLSRC} | gunzip -c > ${.TARGET}
+.endfor
 
 CLEANFILES+=   ${${PACKAGE}FILES}}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319294 - head/usr.bin/mkimg/tests

2017-05-31 Thread Ngie Cooper
Author: ngie
Date: Wed May 31 07:49:49 2017
New Revision: 319294
URL: https://svnweb.freebsd.org/changeset/base/319294

Log:
  Fix "make rebase" after ^/head@r315776
  
  "make rebase" can be used for rebasing the output files from mkimg
  after making a change to mkimg. This will come in handy soon, per
  bug 219673.
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/mkimg/tests/Makefile

Modified: head/usr.bin/mkimg/tests/Makefile
==
--- head/usr.bin/mkimg/tests/Makefile   Wed May 31 07:42:14 2017
(r319293)
+++ head/usr.bin/mkimg/tests/Makefile   Wed May 31 07:49:49 2017
(r319294)
@@ -4,7 +4,8 @@
 
 PACKAGE=   tests
 
-ATF_TESTS_SH=  mkimg_test
+_REBASE_SCRIPT=mkimg_test
+ATF_TESTS_SH=  ${_REBASE_SCRIPT}
 
 SOURCES!=  cd ${.CURDIR}; echo *.uu
 ${PACKAGE}FILES+=  ${SOURCES:S,.gz.uu,,g}
@@ -16,7 +17,7 @@ $f: $f.gz.uu
 
 CLEANFILES+=   ${${PACKAGE}FILES}}
 
-rebase:
-   (cd ${.CURDIR}; atf-sh mkimg.sh rebase)
+rebase: .PHONY
+   (cd ${.CURDIR}; atf-sh ${_REBASE_SCRIPT}.sh rebase)
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319295 - head/usr.bin/mkimg/tests

2017-05-31 Thread Ngie Cooper
Author: ngie
Date: Wed May 31 08:01:12 2017
New Revision: 319295
URL: https://svnweb.freebsd.org/changeset/base/319295

Log:
  Update the usr.bin/mkimg golden test output files after ^/head@r319125
  
  ^/head@r319125 changed the location of the backup pmbr, requiring the
  output files to be regenerated, since they're binary disk dumps.
  
  The output files were regenerated with "make rebase"--fixed in
  ^/head@r319294.
  
  MFC with: r319125, r319294
  PR:   219673
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu

Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu
==
--- head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uuWed May 31 
07:49:49 2017(r319294)
+++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uuWed May 31 
08:01:12 2017(r319295)
@@ -1,132 +1,132 @@
 # $FreeBSD$
 begin 644 img-1x1-4096-gpt.qcow.gz
-M'XL("*XS(E0``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=RYO=70`K9W;;AS7M47?
-M_16ENT1)5*^UJJJK=$^`!,B;$YSS=@Z0NCX&G7=]?-CDOI"KY]2*(=J$(4.H
-MB>ZMP4'9'MX\'.[^:)I.FK9OVK'9Y^;F[].'-/?^YN%'\^/O?_W;]?T_?OQV
-M-R:'GSSE_K[51M/<@ZT_-V5.ST\MS6'\+^9N/@3-W7MU]@=>W;TW>SEW]=O=
-MF\7/*1NT!X--FCNDUR?D]-K_[O5]=V]7[D[O\=ZNDK?;L<'^P>#O:>Z?Z?4I
-M>;M'-C<\F#NYMZOD[8YL;OHI+$I@F=G<$LRU\*F5S6W!7`>?VO&<_.37]FZN
-MAT\)FX.?M]=-F3O"IXS-M0_F#M<9Z#PWP*<(=Q)R-\*G"'<2,.PNY0[XSQIV%W"'?&>/.0NZ0[XQQ9R%WR'?&N+.0.^0[8]RU
-M(7?(=RWCK@VY0[YK&7=MQ)WBIPAW;<2=(M^UC+LVXDZ1[UK&71MQI\AW+>.N
-MC;A3Y+N6<==&W"GR7*?-XZT/ND.]ZQET?.NC[@SY+N>
-M<7>,N#/DNR/C[AAQ9\AW1\;=,>0.^>[(N#N&W"'?'1EWQY`[Y+LCX^X8ZFB+L.^6YB
-MW$T1=QWRW<2XFR+N.N2[B7$W1=QUR'<3XR[_9T@^AWPW,^[FB+L.^6YFW,TA
-M=\AW,^-N#KE#OIL9=W/('?+=S+B;0^Z0[V;&W1QRAWPW,^[FD#ODNYEQMX3<
-M(=\MC+LEY`[Y;F'<+1%W/7Z*<+=$W/7(=POC;HFXZY'O%L;=$G'7(]\MC+LE
-MXJY'OEL8=TO$78]\MS#NUHB['OEN9=RM$7<]\MW*N%M#[I#O5L;=&G*'?+\VQMT6<7=$
-MOML8=WO$W1'Y;F?<[1%W1^2[G7&WA]PAW^V,NSWD#OEN9]SM(7?(=SOC;@^Y
-M0[[;&7=[R!WRWLOY.POQN`[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?#OO).SO1N0[UM])V-^-R'>LOY.POQN1[UA_)V%_-R+?L?Y.POYN
-M1+YC_9V$_=V(?,?Z.PG[NQ'YCO5W$O9W(_(=Z^\D[.]&Y#O6WTG8WXW(=ZR_
-MD["_&Y'O6'\G87\W(M^Q_D["_FY$OF/]G83]W8A\Q_H["?N["3]%N`O[NPGY
-MCO5W$O9W$_(=Z^\D[.\FY#O6WTG8WTW(=ZR_D["_FY#O6'\G87\W(=^Q_D["
-M_FY"OF/]G83]W81\Q_H["?N["?F.]7<2]G<3\AWK[R3L[R;D.];?2=C?3]8?R=A?SOO).SO9N0[UM])V-_-
-MR'>LOY.POYN1[UA_)V%_-R/?L?Y.POYNP4\1[L+^;D&^8_V=A/W=@GS'^CL)
-M^[L%^8[U=Q+V=POR'>OO).SO%N0[UM])V-\MR'>LOY.POUN0[UA_)V%_MR#?
-ML?Y.POYN0;YC_9V$_=V"?,?Z.PG[NP7YCO5W$O9W"_(=Z^\D[.\6Y#O6WTG8
-MWRW(=ZR_D["_6Y#O6'\G87^WXJ<(=V%_MR+?L?Y.POYN1;YC_9V$_=V*?,?Z
-M.PG[NQ7YCO5W$O9W*_(=Z^\D[.]6Y#O6WTG8WZW(=ZR_D["_6Y'O6'\G87^W
-M(M^Q_D["_FY%OF/]G83]W8I\Q_H["?N[%?F.]7<2]GOO).SO-N0[
-MUM])V-_M^"G"7=C?[]8?R=A?[^8_V=A/W=
-MCGS'^CL)^[L=^8[U=Q+V=SOR'>OO).SO=N0[UM])V-_MR'>LOY.PO]N1[UA_
-M)V%_MR/?L?Y.POYN1[YC_9V$_=V.?,?Z.\T_<'--G0.^NWD*NO\OWZ365
-M.^`[9?V=NOZN2=PUF3L[X*OOU/5WSLOU/7
-MWSW)).Z>5.Z`[Y3U=^KZNR>)NR>5.^`[9?V=NO[NR>GB
-M[(#OE/5WZOJ[OO\MS3.H=\
-MQ_H[=?W=TSQ7N4.^8_V=NO[N:>+N:>$.W7^GK+]3U]\]3=P]+=RA^^^4]7?J
-M^KNG)W]VZ/X[9?V=NOZNG%V=0[YC_9VZ_@[,(=^Q_DY=?P?FD.]8?Z>NO\MS
-MS^H<\AWK[]3U=\_R7.$.W7^GK+]3U]\]2]P]J]PAW['^3EU_]RQQ]ZQRAWS'
-M^CMU_=VST\79(=^Q_DY=?U?.KLXAW['^3EU_!^:0[UA_IZZ_`W/(=ZR_4]??
-MY;GG=0[YCO5WZOJ[YWFNOOU/5W+_-GOS9H?OOE/5WZOJ[LOU/7W[W*O3A=GAWS'^CMU_5TYNSJ'?,?Z.W7]'9A#OF/]
-MG;K^#LPAW['^3EU_E^=>USGD.];?J>OO7N>YRAWR'>OOU/5WKQ-WKPMWZ/X[
-M9?V=NO[N=>+N=>$.W7^GK+]3U]^]/OFS0_??*>OOU/5WY>SJ'/(=Z^_4]7=@
-M#OF.]7?J^CLPAWS'^CMU_5V>>U/GD.]8?Z>NOWN3YPIWZ/X[9?V=NO[N3>+N
-M3>4.^8[U=^KZNS>)NS>5.^0[UM^IZ^_>G"[.#OF.]7?J^KMR=G4.^8[U=^KZ
-M.S"'?,?Z.W7]'9A#OF/]G;K^+L]=U3GD.];?J>OOKO)$.W7^GK+]3U]]=)>ZN"G?H_CME_9VZ_N[JY,\.W7^GK+]3U]^5LZMSR'>L
-M

Re: svn commit: r319125 - head/usr.bin/mkimg

2017-05-31 Thread Ngie Cooper

> On May 31, 2017, at 02:48, Emmanuel Vadot  wrote:
> 
> On Wed, 31 May 2017 00:20:45 -0700
> "Ngie Cooper (yaneurabeya)"  wrote:
> 
>> 
>>> On May 29, 2017, at 05:51, Emmanuel Vadot  wrote:
>>> 
>>> Author: manu
>>> Date: Mon May 29 12:51:02 2017
>>> New Revision: 319125
>>> URL: https://svnweb.freebsd.org/changeset/base/319125
>>> 
>>> Log:
>>> mkimg: Correct an off by one error in the PMBR size
>>> 
>>> The PMBR last sector should be number of sector - 1 (As stated in UEFI Spec
>>> 2.6 page 118 table 17).
>>> This fixes warning printed by linux tools like parted or fdisk.
>> 
>> This commit broke all of the mkimg gpt tests. For example: 
>> https://ci.freebsd.org/job/FreeBSD-head-amd64-test/3280/testReport/junit/usr.bin.mkimg/mkimg_test/gpt_1x1_4096_qcow/
>>  .
>> -Ngie
> 
> Sorry about that and thanks for the fix.

No worries -- it turns out I broke something by accident as well, and I 
fixed both items at the same time.
Take it easy :),
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r319295 - head/usr.bin/mkimg/tests

2017-06-01 Thread Ngie Cooper

> On Jun 1, 2017, at 08:35, Marcel Moolenaar  wrote:
> 
> 
>> On Jun 1, 2017, at 8:32 AM, Alan Somers  wrote:

...

>> If the files are binary, then why not store them as binary files?
> 
> A 100MB image, committed as binary file is 100MB of data. The hexdump -C
> equivalent is often only a few hundred bytes (due to the many zeroes).
> The repo bloat argument has grounds for binary files.

hexdump still has a number of formatting bugs... I guess I should go back and 
write some tests/fix the issues, almost a decade after I tried to take them on 
originally...
Thanks!
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319455 - head/tests/sys/opencrypto

2017-06-01 Thread Ngie Cooper
Author: ngie
Date: Thu Jun  1 19:46:48 2017
New Revision: 319455
URL: https://svnweb.freebsd.org/changeset/base/319455

Log:
  Fix up `TEST_METADATA`
  
  - `TEST_METADATA.foo` should be `TEST_METADATA.run_tests`: this will unbreak
trying to run the tests on a system without python installed in $PATH.
  - The tests require root because they load aesni(4) and/or cryptodev(4) if
not already loaded.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/opencrypto/Makefile

Modified: head/tests/sys/opencrypto/Makefile
==
--- head/tests/sys/opencrypto/Makefile  Thu Jun  1 19:27:38 2017
(r319454)
+++ head/tests/sys/opencrypto/Makefile  Thu Jun  1 19:46:48 2017
(r319455)
@@ -7,7 +7,9 @@ BINDIR= ${TESTSDIR}
 
 PLAIN_TESTS_SH=runtests
 
-TEST_METADATA.foo+=required_programs="python"
+TEST_METADATA.runtests+= required_programs="python"
+TEST_METADATA.runtests+= required_user="root"
+
 PYMODULES= cryptodev.py cryptodevh.py cryptotest.py dpkt.py
 
 ${PACKAGE}FILES+=  ${PYMODULES}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319456 - head/tests/sys/opencrypto

2017-06-01 Thread Ngie Cooper
Author: ngie
Date: Thu Jun  1 19:58:40 2017
New Revision: 319456
URL: https://svnweb.freebsd.org/changeset/base/319456

Log:
  tests/sys/opencrypto/runtests: apply minor polish to test script
  
  - Refactor kld loading/unloading logic:
  -- Use a loop instead of an unrolled one.
  -- Check for the module being loaded before trying to load it, to reduce
 noise when loading modules that are already loaded.
  -- Don't mute stderr from kldload -- it could be potentially useful to
 the tester.
  -- In the event that the test script was terminated early, it would leave
 the modules still attached to the system (which is undesirable).
 Always unload the modules at test end with EXIT/SIGINT/SIGTERM so the
 system is returned to its former operating state as best possible.
 Unload the modules in reverse order, in part for consistency and/or
 dependency reasons.
  
  MFC after:2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/opencrypto/runtests.sh

Modified: head/tests/sys/opencrypto/runtests.sh
==
--- head/tests/sys/opencrypto/runtests.sh   Thu Jun  1 19:46:48 2017
(r319455)
+++ head/tests/sys/opencrypto/runtests.sh   Thu Jun  1 19:58:40 2017
(r319456)
@@ -29,21 +29,34 @@
 # $FreeBSD$
 #
 
-set -e
+set -ex
 
 if [ ! -d /usr/local/share/nist-kat ]; then
echo 'Skipping, nist-kat package not installed for test vectors.'
exit 0
 fi
 
-if kldload aesni 2>/dev/null; then
-   unloadaesni=1
-fi
+loaded_modules=
+cleanup_tests()
+{
+   trap - EXIT INT TERM
 
-if kldload cryptodev 2>/dev/null; then
-   unloadcdev=1
-fi
+   set +e
 
+   # Unload modules in reverse order
+   for loaded_module in $(echo $loaded_modules | tr ' ' '\n' | sort -r); do
+   kldunload $loaded_module
+   done
+}
+trap cleanup_tests EXIT INT TERM
+
+for required_module in aesni cryptodev; do
+   if ! kldstat -q -m $required_module; then
+   kldload $required_module
+   loaded_modules="$loaded_modules $required_module"
+   fi
+done
+
 # Run software crypto test
 oldcdas=$(sysctl -e kern.cryptodevallowsoft)
 sysctl kern.cryptodevallowsoft=1
@@ -51,10 +64,3 @@ sysctl kern.cryptodevallowsoft=1
 python $(dirname $0)/cryptotest.py
 
 sysctl "$oldcdas"
-
-if [ x"$unloadcdev" = x"1" ]; then
-   kldunload cryptodev
-fi
-if [ x"$unloadaesni" = x"1" ]; then
-   kldunload aesni
-fi
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319543 - head/bin/dd/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 17:56:31 2017
New Revision: 319543
URL: https://svnweb.freebsd.org/changeset/base/319543

Log:
  Stylistic tweaks
  
  Move opening braces of functions from the last column to column 0.
  
  MFC after:18 days
  MFC with: r319339
  Sponsored by: Dell EMC Isilon

Modified:
  head/bin/dd/tests/dd2_test.sh

Modified: head/bin/dd/tests/dd2_test.sh
==
--- head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:24:13 2017
(r319542)
+++ head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:56:31 2017
(r319543)
@@ -27,10 +27,12 @@
 
 
 atf_test_case seek_overflow
-seek_overflow_head() {
+seek_overflow_head()
+{
atf_set "descr" "dd(1) should reject too-large seek values"
 }
-seek_overflow_body() {
+seek_overflow_body()
+{
touch f.in
# Positive tests
seek=`echo "2^63 / 4096 - 1" | bc`
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r319544 - head/bin/dd/tests

2017-06-03 Thread Ngie Cooper
Author: ngie
Date: Sat Jun  3 17:59:10 2017
New Revision: 319544
URL: https://svnweb.freebsd.org/changeset/base/319544

Log:
  Mark :seek_overflow as an expected failure
  
  MFC after:18 days
  MFC with: r319339
  PR:   219757
  Sponsored by: Dell EMC Isilon

Modified:
  head/bin/dd/tests/dd2_test.sh

Modified: head/bin/dd/tests/dd2_test.sh
==
--- head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:56:31 2017
(r319543)
+++ head/bin/dd/tests/dd2_test.sh   Sat Jun  3 17:59:10 2017
(r319544)
@@ -33,6 +33,8 @@ seek_overflow_head()
 }
 seek_overflow_body()
 {
+   atf_expect_fail "fails with 'dd: truncating f.out: File too large' - 
bug 219757"
+
touch f.in
# Positive tests
seek=`echo "2^63 / 4096 - 1" | bc`
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


  1   2   3   4   5   6   7   8   9   10   >