svn commit: r312124 - head/sys/fs/tmpfs

2017-01-13 Thread Mateusz Guzik
Author: mjg
Date: Sat Jan 14 06:20:36 2017
New Revision: 312124
URL: https://svnweb.freebsd.org/changeset/base/312124

Log:
  tmpfs: manage tm_pages_used with atomics
  
  Reviewed by:  kib (previous version)

Modified:
  head/sys/fs/tmpfs/tmpfs.h
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/fs/tmpfs/tmpfs_vfsops.c

Modified: head/sys/fs/tmpfs/tmpfs.h
==
--- head/sys/fs/tmpfs/tmpfs.h   Sat Jan 14 06:18:54 2017(r312123)
+++ head/sys/fs/tmpfs/tmpfs.h   Sat Jan 14 06:20:36 2017(r312124)
@@ -312,12 +312,12 @@ struct tmpfs_mount {
/* Maximum number of memory pages available for use by the file
 * system, set during mount time.  This variable must never be
 * used directly as it may be bigger than the current amount of
-* free memory; in the extreme case, it will hold the SIZE_MAX
+* free memory; in the extreme case, it will hold the ULONG_MAX
 * value. */
-   size_t  tm_pages_max;
+   u_long  tm_pages_max;
 
/* Number of pages in use by the file system. */
-   size_t  tm_pages_used;
+   u_long  tm_pages_used;
 
/* Pointer to the node representing the root directory of this
 * file system. */

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Sat Jan 14 06:18:54 2017
(r312123)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Sat Jan 14 06:20:36 2017
(r312124)
@@ -129,7 +129,7 @@ tmpfs_pages_check_avail(struct tmpfs_mou
if (tmpfs_mem_avail() < req_pages)
return (0);
 
-   if (tmp->tm_pages_max != SIZE_MAX &&
+   if (tmp->tm_pages_max != ULONG_MAX &&
tmp->tm_pages_max < req_pages + tmpfs_pages_used(tmp))
return (0);
 
@@ -327,9 +327,7 @@ tmpfs_free_node(struct tmpfs_mount *tmp,
case VREG:
uobj = node->tn_reg.tn_aobj;
if (uobj != NULL) {
-   TMPFS_LOCK(tmp);
-   tmp->tm_pages_used -= uobj->size;
-   TMPFS_UNLOCK(tmp);
+   atomic_subtract_long(>tm_pages_used, uobj->size);
KASSERT((uobj->flags & OBJ_TMPFS) == 0,
("leaked OBJ_TMPFS node %p vm_obj %p", node, uobj));
vm_object_deallocate(uobj);
@@ -1417,9 +1415,7 @@ retry:
uobj->size = newpages;
VM_OBJECT_WUNLOCK(uobj);
 
-   TMPFS_LOCK(tmp);
-   tmp->tm_pages_used += (newpages - oldpages);
-   TMPFS_UNLOCK(tmp);
+   atomic_add_long(>tm_pages_used, newpages - oldpages);
 
node->tn_size = newsize;
return (0);

Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c
==
--- head/sys/fs/tmpfs/tmpfs_vfsops.cSat Jan 14 06:18:54 2017
(r312123)
+++ head/sys/fs/tmpfs/tmpfs_vfsops.cSat Jan 14 06:20:36 2017
(r312124)
@@ -397,7 +397,7 @@ tmpfs_statfs(struct mount *mp, struct st
sbp->f_bsize = PAGE_SIZE;
 
used = tmpfs_pages_used(tmp);
-   if (tmp->tm_pages_max != SIZE_MAX)
+   if (tmp->tm_pages_max != ULONG_MAX)
 sbp->f_blocks = tmp->tm_pages_max;
else
 sbp->f_blocks = used + tmpfs_mem_avail();
___
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: r312122 - head/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 06:16:57 2017
New Revision: 312122
URL: https://svnweb.freebsd.org/changeset/base/312122

Log:
  Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind
  
  This should have been pruned in r305358
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Deleted:
  head/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/
___
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: r312121 - head/tests/sys/kern/execve

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 05:24:35 2017
New Revision: 312121
URL: https://svnweb.freebsd.org/changeset/base/312121

Log:
  Follow up to r312118
  
  State that execve failed instead of just printing out the program name
  and strerror(errno) via err(3).
  
  MFC after:3 days
  X-MFC with:   r312118
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/kern/execve/execve_helper.c

Modified: head/tests/sys/kern/execve/execve_helper.c
==
--- head/tests/sys/kern/execve/execve_helper.c  Sat Jan 14 05:18:18 2017
(r312120)
+++ head/tests/sys/kern/execve/execve_helper.c  Sat Jan 14 05:24:35 2017
(r312121)
@@ -50,5 +50,5 @@ main(int argc, char **argv)
}
 
execve(argv[1], [1], NULL);
-   err(1, "%s", "");
+   err(1, "execve 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: r312120 - head/tests/sys/mac/bsdextended

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 05:18:18 2017
New Revision: 312120
URL: https://svnweb.freebsd.org/changeset/base/312120

Log:
  Fix warnings
  
  - Staticize test_num
  - Promote i to size_t to deal with -Wsign-compare issues
  
  Tested with:  clang, gcc, gcc49
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/mac/bsdextended/ugidfw_test.c

Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c
==
--- head/tests/sys/mac/bsdextended/ugidfw_test.cSat Jan 14 05:06:14 
2017(r312119)
+++ head/tests/sys/mac/bsdextended/ugidfw_test.cSat Jan 14 05:18:18 
2017(r312120)
@@ -71,7 +71,7 @@ static const char *test_groups[] = {
"bin",
 };
 
-int test_num;
+static int test_num;
 
 /*
  * List of test strings that must go in (and come out) of libugidfw intact.
@@ -149,7 +149,8 @@ test_libugidfw_strings(void)
struct mac_bsdextended_rule rule;
char errorstr[256];
char rulestr[256];
-   int error, i;
+   size_t i;
+   int error;
 
for (i = 0; i < nitems(test_users); i++, test_num++) {
if (getpwnam(test_users[i]) == NULL)
@@ -171,7 +172,7 @@ test_libugidfw_strings(void)
error = bsde_parse_rule_string(test_strings[i], ,
sizeof(errorstr), errorstr);
if (error == -1)
-   printf("not ok %d # bsde_parse_rule_string: '%s' (%d) "
+   printf("not ok %d # bsde_parse_rule_string: '%s' (%zu) "
"failed: %s\n", test_num, test_strings[i], i, 
errorstr);
else
printf("ok %d\n", test_num);
___
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: r312119 - head/sys/kern

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 05:06:14 2017
New Revision: 312119
URL: https://svnweb.freebsd.org/changeset/base/312119

Log:
  encode_long, encode_timeval: mechanically replace `exp` with `exponent`
  
  This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test,
  which include math.h, which in turn defines exp(3)
  
  MFC after:2 weeks
  Tested with:  clang, gcc 4.2.1, gcc 4.9
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/kern_acct.c

Modified: head/sys/kern/kern_acct.c
==
--- head/sys/kern/kern_acct.c   Sat Jan 14 05:02:53 2017(r312118)
+++ head/sys/kern/kern_acct.c   Sat Jan 14 05:06:14 2017(r312119)
@@ -469,8 +469,8 @@ static uint32_t
 encode_timeval(struct timeval tv)
 {
int log2_s;
-   int val, exp;   /* Unnormalized value and exponent */
-   int norm_exp;   /* Normalized exponent */
+   int val, exponent;  /* Unnormalized value and exponent */
+   int norm_exponent;  /* Normalized exponent */
int shift;
 
/*
@@ -481,7 +481,7 @@ encode_timeval(struct timeval tv)
if (tv.tv_sec == 0) {
if (tv.tv_usec == 0)
return (0);
-   exp = 0;
+   exponent = 0;
val = tv.tv_usec;
} else {
/*
@@ -490,24 +490,24 @@ encode_timeval(struct timeval tv)
 */
log2_s = fls(tv.tv_sec) - 1;
if (log2_s + LOG2_1M < CALC_BITS) {
-   exp = 0;
+   exponent = 0;
val = 100 * tv.tv_sec + tv.tv_usec;
} else {
-   exp = log2_s + LOG2_1M - CALC_BITS;
+   exponent = log2_s + LOG2_1M - CALC_BITS;
val = (unsigned int)(((uint64_t)100 * tv.tv_sec +
-   tv.tv_usec) >> exp);
+   tv.tv_usec) >> exponent);
}
}
/* Now normalize and pack the value into an IEEE-754 float. */
-   norm_exp = fls(val) - 1;
-   shift = FLT_MANT_DIG - norm_exp - 1;
+   norm_exponent = fls(val) - 1;
+   shift = FLT_MANT_DIG - norm_exponent - 1;
 #ifdef ACCT_DEBUG
printf("val=%d exp=%d shift=%d log2(val)=%d\n",
-   val, exp, shift, norm_exp);
-   printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp,
+   val, exponent, shift, norm_exponent);
+   printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exponent + norm_exponent,
((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK));
 #endif
-   return (((FLT_MAX_EXP - 1 + exp + norm_exp) << (FLT_MANT_DIG - 1)) |
+   return (((FLT_MAX_EXP - 1 + exponent + norm_exponent) << (FLT_MANT_DIG 
- 1)) |
((shift > 0 ? val << shift : val >> -shift) & MANT_MASK));
 }
 
@@ -518,7 +518,7 @@ encode_timeval(struct timeval tv)
 static uint32_t
 encode_long(long val)
 {
-   int norm_exp;   /* Normalized exponent */
+   int norm_exponent;  /* Normalized exponent */
int shift;
 
if (val == 0)
@@ -529,15 +529,15 @@ encode_long(long val)
val);
val = LONG_MAX;
}
-   norm_exp = fls(val) - 1;
-   shift = FLT_MANT_DIG - norm_exp - 1;
+   norm_exponent = fls(val) - 1;
+   shift = FLT_MANT_DIG - norm_exponent - 1;
 #ifdef ACCT_DEBUG
printf("val=%d shift=%d log2(val)=%d\n",
-   val, shift, norm_exp);
-   printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp,
+   val, shift, norm_exponent);
+   printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exponent,
((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK));
 #endif
-   return (((FLT_MAX_EXP - 1 + norm_exp) << (FLT_MANT_DIG - 1)) |
+   return (((FLT_MAX_EXP - 1 + norm_exponent) << (FLT_MANT_DIG - 1)) |
((shift > 0 ? val << shift : val >> -shift) & MANT_MASK));
 }
 
___
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: r312118 - head/tests/sys/kern/execve

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 05:02:53 2017
New Revision: 312118
URL: https://svnweb.freebsd.org/changeset/base/312118

Log:
  Fix -Wformat issue with zero-length format string passed to err(3)
  
  MFC after:3 days
  Tested with:  clang, gcc 4.2.1, gcc 4.9
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/kern/execve/execve_helper.c

Modified: head/tests/sys/kern/execve/execve_helper.c
==
--- head/tests/sys/kern/execve/execve_helper.c  Sat Jan 14 04:34:30 2017
(r312117)
+++ head/tests/sys/kern/execve/execve_helper.c  Sat Jan 14 05:02:53 2017
(r312118)
@@ -50,5 +50,5 @@ main(int argc, char **argv)
}
 
execve(argv[1], [1], NULL);
-   err(1, "");
+   err(1, "%s", "");
 }
___
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: r312103 - head/tests/sys/vfs

2017-01-13 Thread Cy Schubert
No problem.

My make.conf doesn't adjust any warning levels, they're vanilla so, the 
build barfed at that line.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


In message 
, Conrad Meyer writes:
> Hi Cy,
> 
> r312107 fixes it.  If the warning-cleanups and major changes were
> committed separately, the more major changes could then have been
> reverted independently.  Unfortunately, they were not.  The warnings
> are harmless, though, so just turning them down again is fine.
> 
> Best,
> Conrad
> 
> On Fri, Jan 13, 2017 at 6:39 PM, Cy Schubert  wrote
> :
> > In message <201701140103.v0e13k8b068...@repo.freebsd.org>, "Conrad E.
> > Meyer" wr
> > ites:
> >> Author: cem
> >> Date: Sat Jan 14 01:03:20 2017
> >> New Revision: 312103
> >> URL: https://svnweb.freebsd.org/changeset/base/312103
> >>
> >> Log:
> >>   Revert r310994
> >>
> >>   Don't implement some terrible hack on a test by test basis.  The
> >>   framework fix is straightforward and can be chased up in the original
> >>   bug.
> >>
> >>   Reviewed by:ngie ("be my guest")
> >>
> >> Modified:
> >>   head/tests/sys/vfs/lookup_cap_dotdot.c
> >>
> >> Modified: head/tests/sys/vfs/lookup_cap_dotdot.c
> >> ==
> ===
> >> =
> >> --- head/tests/sys/vfs/lookup_cap_dotdot.cSat Jan 14 01:01:02 2017
> >>   (r312102)
> >> +++ head/tests/sys/vfs/lookup_cap_dotdot.cSat Jan 14 01:03:20 2017
> >>   (r312103)
> >> @@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$");
> >>  #include 
> >>  #include 
> >>  #include 
> >> -#include 
> >>
> >>  #include 
> >> -#include 
> >>  #include 
> >>  #include 
> >>  #include 
> >>
> >>  #include "freebsd_test_suite/macros.h"
> >>
> >> -static char  *abspath;
> >> -static int   dirfd = -1;
> >> -
> >> -typedef  void (*child_test_fn_t)(void);
> >> +static int dirfd = -1;
> >> +static char *abspath;
> >>
> >>  static void
> >> -touchat(int _dirfd, const char *name)
> >> +touchat(int dirfd, const char *name)
> >
> > Buildworld is busted right here. It's probably best to leave the underbar
> > here and in the ATF_REQIRE below.
> >
> >>  {
> >>   int fd;
> >>
> >> - ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
> >> + ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
> >
> > Here too.
> >
> >>   0777)) >= 0);
> >>   ATF_REQUIRE(close(fd) == 0);
> >>  }
> >
> >
> > --
> > Cheers,
> > Cy Schubert 
> > FreeBSD UNIX:     Web:  http://www.FreeBSD.org
> >
> > The need of the many outweighs the greed of the few.
> >
> >
> 


___
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: r312115 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 04:20:42 2017
New Revision: 312115
URL: https://svnweb.freebsd.org/changeset/base/312115

Log:
  Remove WARNS set globally by ../Makefile.inc now
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/vfs/Makefile

Modified: head/tests/sys/vfs/Makefile
==
--- head/tests/sys/vfs/Makefile Sat Jan 14 04:20:06 2017(r312114)
+++ head/tests/sys/vfs/Makefile Sat Jan 14 04:20:42 2017(r312115)
@@ -9,6 +9,4 @@ CFLAGS.lookup_cap_dotdot.c+=-I${SRCTOP}
 
 PLAIN_TESTS_SH+=   trailing_slash
 
-WARNS?=6
-
 .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: r312114 - head/tests/sys

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 04:20:06 2017
New Revision: 312114
URL: https://svnweb.freebsd.org/changeset/base/312114

Log:
  Enable WARNS?= 6 across all of tests/sys
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Added:
  head/tests/sys/Makefile.inc   (contents, props changed)

Added: head/tests/sys/Makefile.inc
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/Makefile.inc Sat Jan 14 04:20:06 2017(r312114)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+WARNS?=6
___
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: r312113 - head/sys/kern

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 04:16:13 2017
New Revision: 312113
URL: https://svnweb.freebsd.org/changeset/base/312113

Log:
  Clean up trailing whitespace
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/subr_unit.c

Modified: head/sys/kern/subr_unit.c
==
--- head/sys/kern/subr_unit.c   Sat Jan 14 04:13:28 2017(r312112)
+++ head/sys/kern/subr_unit.c   Sat Jan 14 04:16:13 2017(r312113)
@@ -216,7 +216,7 @@ ub_full(struct unrb *ub, int len)
  * Consistency check function.
  *
  * Checks the internal consistency as well as we can.
- * 
+ *
  * Called at all boundaries of this API.
  */
 static void
@@ -240,7 +240,7 @@ check_unrhdr(struct unrhdr *uh, int line
w = 0;
bit_count(ub->map, 0, up->len, );
y += w;
-   } else if (up->ptr != NULL) 
+   } else if (up->ptr != NULL)
y += up->len;
}
KASSERT (y == uh->busy,
@@ -375,7 +375,7 @@ is_bitmap(struct unrhdr *uh, struct unr 
 /*
  * Look for sequence of items which can be combined into a bitmap, if
  * multiple are present, take the one which saves most memory.
- * 
+ *
  * Return (1) if a sequence was found to indicate that another call
  * might be able to do more.  Return (0) if we found no suitable sequence.
  *
@@ -591,7 +591,7 @@ alloc_unrl(struct unrhdr *uh)
}
 
/*
-* We can always allocate from the first list element, so if we have 
+* We can always allocate from the first list element, so if we have
 * nothing on the list, we must have run out of unit numbers.
 */
if (up == NULL)
@@ -803,7 +803,7 @@ free_unrl(struct unrhdr *uh, u_int item,
/* Handle bitmap items */
if (is_bitmap(uh, up)) {
ub = up->ptr;
-   
+
KASSERT(bit_test(ub->map, item) != 0,
("UNR: Freeing free item %d (bitmap)\n", item));
bit_clear(ub->map, item);
@@ -909,7 +909,7 @@ print_unr(struct unrhdr *uh, struct unr 
for (x = 0; x < up->len; x++) {
if (bit_test(ub->map, x))
printf("#");
-   else 
+   else
printf(" ");
}
printf("]\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: r312112 - head/sys/kern

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 04:13:28 2017
New Revision: 312112
URL: https://svnweb.freebsd.org/changeset/base/312112

Log:
  Fix -Wunused on gcc 4.9 (x was set but not used)
  
  MFC after:3 days
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kern/subr_unit.c

Modified: head/sys/kern/subr_unit.c
==
--- head/sys/kern/subr_unit.c   Sat Jan 14 04:10:04 2017(r312111)
+++ head/sys/kern/subr_unit.c   Sat Jan 14 04:13:28 2017(r312112)
@@ -986,7 +986,7 @@ main(int argc, char **argv)
long count = 1; /* Number of unrs to test */
long reps = 1, m;
int ch;
-   u_int i, x, j;
+   u_int i, j;
 
verbose = false;
 
@@ -999,7 +999,7 @@ main(int argc, char **argv)
usage(argv);
exit(2);
}
-   
+
break;
case 'v':
verbose = true;
@@ -1026,7 +1026,6 @@ main(int argc, char **argv)
printf("sizeof(struct unrb) %zu\n", sizeof(struct unrb));
printf("sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr));
printf("NBITS %lu\n", (unsigned long)NBITS);
-   x = 1;
for (m = 0; m < count * reps; m++) {
j = random();
i = (j >> 1) % count;
___
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: r312111 - head/tests/sys/file

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 04:10:04 2017
New Revision: 312111
URL: https://svnweb.freebsd.org/changeset/base/312111

Log:
  Remove unused vars to fix -Wunused issues
  
  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.cSat Jan 14 04:09:01 2017
(r312110)
+++ head/tests/sys/file/ftruncate_test.cSat Jan 14 04:10:04 2017
(r312111)
@@ -57,7 +57,7 @@ static off_t lengths[] = {0, 1, 2, 3, 4,
 static int lengths_count = sizeof(lengths) / sizeof(off_t);
 
 int
-main(int argc, char *argv[])
+main(void)
 {
int error, fd, fds[2], i, read_only_fd;
char path[PATH_MAX];
___
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: r312110 - head/tests/sys/vm

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 04:09:01 2017
New Revision: 312110
URL: https://svnweb.freebsd.org/changeset/base/312110

Log:
  Fix -Wsign-compare warnings
  
  The loop index (i) doesn't need to be size_t as its comparison is signed
  
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/vm/mmap_test.c

Modified: head/tests/sys/vm/mmap_test.c
==
--- head/tests/sys/vm/mmap_test.c   Sat Jan 14 04:00:26 2017
(r312109)
+++ head/tests/sys/vm/mmap_test.c   Sat Jan 14 04:09:01 2017
(r312110)
@@ -184,8 +184,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_priva
 ATF_TC_BODY(mmap__dev_zero_private, tc)
 {
char *p1, *p2, *p3;
-   size_t i;
-   int fd, pagesize;
+   int fd, i, pagesize;
 
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDONLY)) >= 0);
@@ -197,7 +196,7 @@ ATF_TC_BODY(mmap__dev_zero_private, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
 
for (i = 0; i < pagesize; i++)
-   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
+   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
 
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 0);
 
@@ -224,8 +223,7 @@ ATF_TC_WITHOUT_HEAD(mmap__dev_zero_share
 ATF_TC_BODY(mmap__dev_zero_shared, tc)
 {
char *p1, *p2, *p3;
-   size_t i;
-   int fd, pagesize;
+   int fd, i, pagesize;
 
ATF_REQUIRE((pagesize = getpagesize()) > 0);
ATF_REQUIRE((fd = open("/dev/zero", O_RDWR)) >= 0);
@@ -237,7 +235,7 @@ ATF_TC_BODY(mmap__dev_zero_shared, tc)
ATF_REQUIRE(p2 != MAP_FAILED);
 
for (i = 0; i < pagesize; i++)
-   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%zu] is %x", i, p1[i]);
+   ATF_REQUIRE_EQ_MSG(0, p1[i], "byte at p1[%d] is %x", i, p1[i]);
 
ATF_REQUIRE(memcmp(p1, p2, pagesize) == 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"


Re: svn commit: r312103 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper (yaneurabeya)

> On Jan 13, 2017, at 7:50 PM, Conrad Meyer  wrote:
> 
> Hi Cy,
> 
> r312107 fixes it.  If the warning-cleanups and major changes were
> committed separately, the more major changes could then have been
> reverted independently.  Unfortunately, they were not.  The warnings
> are harmless, though, so just turning them down again is fine.

Trivial fixes reapplied in r312109.
___
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: r312109 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 04:00:26 2017
New Revision: 312109
URL: https://svnweb.freebsd.org/changeset/base/312109

Log:
  Bump WARNS up to 6 again
  
  Has not been tested (can't be after r312103 without cem's hacks
  to atf/kyua)!

Modified:
  head/tests/sys/vfs/Makefile
  head/tests/sys/vfs/lookup_cap_dotdot.c

Modified: head/tests/sys/vfs/Makefile
==
--- head/tests/sys/vfs/Makefile Sat Jan 14 03:54:23 2017(r312108)
+++ head/tests/sys/vfs/Makefile Sat Jan 14 04:00:26 2017(r312109)
@@ -9,4 +9,6 @@ CFLAGS.lookup_cap_dotdot.c+=-I${SRCTOP}
 
 PLAIN_TESTS_SH+=   trailing_slash
 
+WARNS?=6
+
 .include 

Modified: head/tests/sys/vfs/lookup_cap_dotdot.c
==
--- head/tests/sys/vfs/lookup_cap_dotdot.c  Sat Jan 14 03:54:23 2017
(r312108)
+++ head/tests/sys/vfs/lookup_cap_dotdot.c  Sat Jan 14 04:00:26 2017
(r312109)
@@ -43,11 +43,11 @@ static int dirfd = -1;
 static char *abspath;
 
 static void
-touchat(int dirfd, const char *name)
+touchat(int _dirfd, const char *name)
 {
int fd;
 
-   ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
+   ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
0777)) >= 0);
ATF_REQUIRE(close(fd) == 0);
 }
@@ -117,7 +117,6 @@ ATF_TC_HEAD(lookup_cap_dotdot__basic, tc
 ATF_TC_BODY(lookup_cap_dotdot__basic, tc)
 {
cap_rights_t rights;
-   int fd;
 
check_capsicum();
prepare_dotdot_tests();
@@ -141,7 +140,6 @@ ATF_TC_HEAD(lookup_cap_dotdot__advanced,
 ATF_TC_BODY(lookup_cap_dotdot__advanced, tc)
 {
cap_rights_t rights;
-   int fd;
 
check_capsicum();
prepare_dotdot_tests();
@@ -220,7 +218,6 @@ ATF_TC_HEAD(lookup_cap_dotdot__negative,
 ATF_TC_BODY(lookup_cap_dotdot__negative, tc)
 {
cap_rights_t rights;
-   int fd;
 
check_capsicum();
prepare_dotdot_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: r312108 - head/contrib/netbsd-tests/lib/libc/gen/posix_spawn

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 03:54:23 2017
New Revision: 312108
URL: https://svnweb.freebsd.org/changeset/base/312108

Log:
  Delete trailing whitespace and use __arraycount instead of nitems in contrib 
code
  
  MFC after:1 week

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

Modified: head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c
==
--- head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.cSat Jan 
14 02:29:25 2017(r312107)
+++ head/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.cSat Jan 
14 03:54:23 2017(r312108)
@@ -60,16 +60,16 @@ get_different_scheduler(void)
 
/* get current schedule policy */
scheduler = sched_getscheduler(0);
-   for (i = 0; i < nitems(schedulers); i++) {
+   for (i = 0; i < __arraycount(schedulers); i++) {
if (schedulers[i] == scheduler)
break;
}
-   ATF_REQUIRE_MSG(i < nitems(schedulers),
+   ATF_REQUIRE_MSG(i < __arraycount(schedulers),
"Unknown current scheduler %d", scheduler);
-   
+
/* new scheduler */
i++;
-   if (i >= nitems(schedulers))
+   if (i >= __arraycount(schedulers))
i = 0;
return schedulers[i];
 }
@@ -85,7 +85,7 @@ get_different_priority(int scheduler)
 
sched_getparam(0, );
priority = param.sched_priority;
-   
+
/*
 * Change numerical value of the priority, to ensure that it
 * was set for the spawned child.
@@ -127,7 +127,7 @@ ATF_TC_BODY(t_spawnattr, tc)
scheduler = get_different_scheduler();
priority = get_different_priority(scheduler);
sp.sched_priority = priority;
-   
+
sigemptyset();
sigaddset(, SIGUSR1);
 
___
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: r312103 - head/tests/sys/vfs

2017-01-13 Thread Conrad Meyer
Hi Cy,

r312107 fixes it.  If the warning-cleanups and major changes were
committed separately, the more major changes could then have been
reverted independently.  Unfortunately, they were not.  The warnings
are harmless, though, so just turning them down again is fine.

Best,
Conrad

On Fri, Jan 13, 2017 at 6:39 PM, Cy Schubert  wrote:
> In message <201701140103.v0e13k8b068...@repo.freebsd.org>, "Conrad E.
> Meyer" wr
> ites:
>> Author: cem
>> Date: Sat Jan 14 01:03:20 2017
>> New Revision: 312103
>> URL: https://svnweb.freebsd.org/changeset/base/312103
>>
>> Log:
>>   Revert r310994
>>
>>   Don't implement some terrible hack on a test by test basis.  The
>>   framework fix is straightforward and can be chased up in the original
>>   bug.
>>
>>   Reviewed by:ngie ("be my guest")
>>
>> Modified:
>>   head/tests/sys/vfs/lookup_cap_dotdot.c
>>
>> Modified: head/tests/sys/vfs/lookup_cap_dotdot.c
>> =
>> =
>> --- head/tests/sys/vfs/lookup_cap_dotdot.cSat Jan 14 01:01:02 2017
>>   (r312102)
>> +++ head/tests/sys/vfs/lookup_cap_dotdot.cSat Jan 14 01:03:20 2017
>>   (r312103)
>> @@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$");
>>  #include 
>>  #include 
>>  #include 
>> -#include 
>>
>>  #include 
>> -#include 
>>  #include 
>>  #include 
>>  #include 
>>
>>  #include "freebsd_test_suite/macros.h"
>>
>> -static char  *abspath;
>> -static int   dirfd = -1;
>> -
>> -typedef  void (*child_test_fn_t)(void);
>> +static int dirfd = -1;
>> +static char *abspath;
>>
>>  static void
>> -touchat(int _dirfd, const char *name)
>> +touchat(int dirfd, const char *name)
>
> Buildworld is busted right here. It's probably best to leave the underbar
> here and in the ATF_REQIRE below.
>
>>  {
>>   int fd;
>>
>> - ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
>> + ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
>
> Here too.
>
>>   0777)) >= 0);
>>   ATF_REQUIRE(close(fd) == 0);
>>  }
>
>
> --
> Cheers,
> Cy Schubert 
> FreeBSD UNIX:     Web:  http://www.FreeBSD.org
>
> The need of the many outweighs the greed of the few.
>
>
___
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: r312103 - head/tests/sys/vfs

2017-01-13 Thread Cy Schubert
In message <201701140103.v0e13k8b068...@repo.freebsd.org>, "Conrad E. 
Meyer" wr
ites:
> Author: cem
> Date: Sat Jan 14 01:03:20 2017
> New Revision: 312103
> URL: https://svnweb.freebsd.org/changeset/base/312103
> 
> Log:
>   Revert r310994
>   
>   Don't implement some terrible hack on a test by test basis.  The
>   framework fix is straightforward and can be chased up in the original
>   bug.
>   
>   Reviewed by:ngie ("be my guest")
> 
> Modified:
>   head/tests/sys/vfs/lookup_cap_dotdot.c
> 
> Modified: head/tests/sys/vfs/lookup_cap_dotdot.c
> =
> =
> --- head/tests/sys/vfs/lookup_cap_dotdot.cSat Jan 14 01:01:02 2017
>   (r312102)
> +++ head/tests/sys/vfs/lookup_cap_dotdot.cSat Jan 14 01:03:20 2017
>   (r312103)
> @@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#include 
>  
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
>  
>  #include "freebsd_test_suite/macros.h"
>  
> -static char  *abspath;
> -static int   dirfd = -1;
> -
> -typedef  void (*child_test_fn_t)(void);
> +static int dirfd = -1;
> +static char *abspath;
>  
>  static void
> -touchat(int _dirfd, const char *name)
> +touchat(int dirfd, const char *name)

Buildworld is busted right here. It's probably best to leave the underbar 
here and in the ATF_REQIRE below.

>  {
>   int fd;
>  
> - ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
> + ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,

Here too.

>   0777)) >= 0);
>   ATF_REQUIRE(close(fd) == 0);
>  }


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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: r312107 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper (yaneurabeya)

> On Jan 13, 2017, at 18:29, Conrad E. Meyer  wrote:
> 
> Author: cem
> Date: Sat Jan 14 02:29:25 2017
> New Revision: 312107
> URL: https://svnweb.freebsd.org/changeset/base/312107
> 
> Log:
>  Follow-up to r312103:
> 
>  Revert r310995 as well.
> 
> Modified:
>  head/tests/sys/vfs/Makefile
> 
> Modified: head/tests/sys/vfs/Makefile
> ==
> --- head/tests/sys/vfs/Makefile   Sat Jan 14 02:26:46 2017
> (r312106)
> +++ head/tests/sys/vfs/Makefile   Sat Jan 14 02:29:25 2017
> (r312107)
> @@ -9,6 +9,4 @@ CFLAGS.lookup_cap_dotdot.c+=  -I${SRCTOP}
> 
> PLAIN_TESTS_SH+=  trailing_slash
> 
> -WARNS?=  6
> -
> .include 

Why don’t you fix the test code to be -Werror clean instead with WARNS?


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r312107 - head/tests/sys/vfs

2017-01-13 Thread Conrad E. Meyer
Author: cem
Date: Sat Jan 14 02:29:25 2017
New Revision: 312107
URL: https://svnweb.freebsd.org/changeset/base/312107

Log:
  Follow-up to r312103:
  
  Revert r310995 as well.

Modified:
  head/tests/sys/vfs/Makefile

Modified: head/tests/sys/vfs/Makefile
==
--- head/tests/sys/vfs/Makefile Sat Jan 14 02:26:46 2017(r312106)
+++ head/tests/sys/vfs/Makefile Sat Jan 14 02:29:25 2017(r312107)
@@ -9,6 +9,4 @@ CFLAGS.lookup_cap_dotdot.c+=-I${SRCTOP}
 
 PLAIN_TESTS_SH+=   trailing_slash
 
-WARNS?=6
-
 .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"


Re: svn commit: r312103 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper (yaneurabeya)

> On Jan 13, 2017, at 17:07, Ngie Cooper (yaneurabeya)  
> wrote:
> 
> 
>> On Jan 13, 2017, at 17:06, Ngie Cooper (yaneurabeya)  
>> wrote:
>> 
>>> 
>>> On Jan 13, 2017, at 17:03, Conrad E. Meyer  wrote:
>>> 
>>> Author: cem
>>> Date: Sat Jan 14 01:03:20 2017
>>> New Revision: 312103
>>> URL: https://svnweb.freebsd.org/changeset/base/312103
>>> 
>>> Log:
>>> Revert r310994
>>> 
>>> Don't implement some terrible hack on a test by test basis.  The
>>> framework fix is straightforward and can be chased up in the original
>>> bug.
>>> 
>>> Reviewed by:ngie ("be my guest")
>> 
>> You should have filed an issue with atf/kyua, had the fix done, then done 
>> the necessary parts in releasing a new port/package. Please disable the test 
>> because it doesn’t work at all right now on CURRENT and it will ping the 
>> sh’t out of the jenkins email until fixed.
>> -Ngie
> 
> PS Saying “be my guest” isn’t review in any shape or form, nor is it my 
> consent towards your change being implemented now.

Oh yeah… this commit broke the build too because I turned on WARNS: 
https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/4653/
Cheers,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r312105 - head/usr.sbin/inetd

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 01:37:03 2017
New Revision: 312105
URL: https://svnweb.freebsd.org/changeset/base/312105

Log:
  Conditionalize libwrap support into inetd based on MK_TCP_WRAPPERS
  
  This will allow inetd to stand by itself without libwrap.
  
  MFC after:2 weeks
  Relnotes: yes
  Reviewed by:  hrs (earlier version)
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D9056

Modified:
  head/usr.sbin/inetd/Makefile
  head/usr.sbin/inetd/inetd.c

Modified: head/usr.sbin/inetd/Makefile
==
--- head/usr.sbin/inetd/MakefileSat Jan 14 01:08:04 2017
(r312104)
+++ head/usr.sbin/inetd/MakefileSat Jan 14 01:37:03 2017
(r312105)
@@ -16,7 +16,12 @@ CFLAGS+= -DLOGIN_CAP
 CFLAGS+= -DINET6
 .endif
 
-LIBADD=util wrap
+LIBADD=util
+
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+=   -DLIBWRAP
+LIBADD+=   wrap
+.endif
 
 # XXX for src/release/picobsd
 .if !defined(RELEASE_CRUNCH)

Modified: head/usr.sbin/inetd/inetd.c
==
--- head/usr.sbin/inetd/inetd.c Sat Jan 14 01:08:04 2017(r312104)
+++ head/usr.sbin/inetd/inetd.c Sat Jan 14 01:37:03 2017(r312105)
@@ -336,9 +336,11 @@ main(int argc, char **argv)
 #ifdef LOGIN_CAP
login_cap_t *lc = NULL;
 #endif
+#ifdef LIBWRAP
struct request_info req;
int denied;
char *service = NULL;
+#endif
struct sockaddr_storage peer;
int i;
struct addrinfo hints, *res;
@@ -748,6 +750,7 @@ main(int argc, char **argv)
_exit(0);
}
}
+#ifdef LIBWRAP
if (ISWRAP(sep)) {
inetd_setproctitle("wrapping", ctrl);
service = sep->se_server_name ?
@@ -776,6 +779,7 @@ main(int argc, char **argv)
(whichaf() == AF_INET6) ? "6" : "");
}
}
+#endif
if (sep->se_bi) {
(*sep->se_bi->bi_fn)(ctrl, sep);
} else {
___
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: r312104 - head/usr.sbin/fstyp/tests

2017-01-13 Thread Ngie Cooper (yaneurabeya)

> On Jan 13, 2017, at 17:08, Conrad E. Meyer  wrote:
> 
> Author: cem
> Date: Sat Jan 14 01:08:04 2017
> New Revision: 312104
> URL: https://svnweb.freebsd.org/changeset/base/312104
> 
> Log:
>  Fix broken fstyp exfat testcase
> 
>  Introduced in r312010.
> 
>  It helps to read the documentation before trying to test something.

It helps when the documentation is correct as well. Not fixed until r312078.
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r312104 - head/usr.sbin/fstyp/tests

2017-01-13 Thread Conrad E. Meyer
Author: cem
Date: Sat Jan 14 01:08:04 2017
New Revision: 312104
URL: https://svnweb.freebsd.org/changeset/base/312104

Log:
  Fix broken fstyp exfat testcase
  
  Introduced in r312010.
  
  It helps to read the documentation before trying to test something.

Modified:
  head/usr.sbin/fstyp/tests/fstyp_test.sh

Modified: head/usr.sbin/fstyp/tests/fstyp_test.sh
==
--- head/usr.sbin/fstyp/tests/fstyp_test.sh Sat Jan 14 01:03:20 2017
(r312103)
+++ head/usr.sbin/fstyp/tests/fstyp_test.sh Sat Jan 14 01:08:04 2017
(r312104)
@@ -64,7 +64,7 @@ exfat_head() {
 }
 exfat_body() {
bzcat $(atf_get_srcdir)/dfr-01-xfat.img.bz2 > exfat.img
-   atf_check -s exit:0 -o inline:"exfat\n" fstyp exfat.img
+   atf_check -s exit:0 -o inline:"exfat\n" fstyp -u exfat.img
 }
 
 atf_test_case empty
___
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: r312103 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper (yaneurabeya)

> On Jan 13, 2017, at 17:06, Ngie Cooper (yaneurabeya)  
> wrote:
> 
>> 
>> On Jan 13, 2017, at 17:03, Conrad E. Meyer  wrote:
>> 
>> Author: cem
>> Date: Sat Jan 14 01:03:20 2017
>> New Revision: 312103
>> URL: https://svnweb.freebsd.org/changeset/base/312103
>> 
>> Log:
>> Revert r310994
>> 
>> Don't implement some terrible hack on a test by test basis.  The
>> framework fix is straightforward and can be chased up in the original
>> bug.
>> 
>> Reviewed by: ngie ("be my guest")
> 
> You should have filed an issue with atf/kyua, had the fix done, then done the 
> necessary parts in releasing a new port/package. Please disable the test 
> because it doesn’t work at all right now on CURRENT and it will ping the sh’t 
> out of the jenkins email until fixed.
> -Ngie

PS Saying “be my guest” isn’t review in any shape or form, nor is it my consent 
towards your change being implemented now.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r312103 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper (yaneurabeya)

> On Jan 13, 2017, at 17:03, Conrad E. Meyer  wrote:
> 
> Author: cem
> Date: Sat Jan 14 01:03:20 2017
> New Revision: 312103
> URL: https://svnweb.freebsd.org/changeset/base/312103
> 
> Log:
>  Revert r310994
> 
>  Don't implement some terrible hack on a test by test basis.  The
>  framework fix is straightforward and can be chased up in the original
>  bug.
> 
>  Reviewed by: ngie ("be my guest")

You should have filed an issue with atf/kyua, had the fix done, then done the 
necessary parts in releasing a new port/package. Please disable the test 
because it doesn’t work at all right now on CURRENT and it will ping the sh’t 
out of the jenkins email until fixed.
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r312103 - head/tests/sys/vfs

2017-01-13 Thread Conrad E. Meyer
Author: cem
Date: Sat Jan 14 01:03:20 2017
New Revision: 312103
URL: https://svnweb.freebsd.org/changeset/base/312103

Log:
  Revert r310994
  
  Don't implement some terrible hack on a test by test basis.  The
  framework fix is straightforward and can be chased up in the original
  bug.
  
  Reviewed by:  ngie ("be my guest")

Modified:
  head/tests/sys/vfs/lookup_cap_dotdot.c

Modified: head/tests/sys/vfs/lookup_cap_dotdot.c
==
--- head/tests/sys/vfs/lookup_cap_dotdot.c  Sat Jan 14 01:01:02 2017
(r312102)
+++ head/tests/sys/vfs/lookup_cap_dotdot.c  Sat Jan 14 01:03:20 2017
(r312103)
@@ -31,27 +31,23 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
 
 #include "freebsd_test_suite/macros.h"
 
-static char*abspath;
-static int dirfd = -1;
-
-typedefvoid (*child_test_fn_t)(void);
+static int dirfd = -1;
+static char *abspath;
 
 static void
-touchat(int _dirfd, const char *name)
+touchat(int dirfd, const char *name)
 {
int fd;
 
-   ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
+   ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
0777)) >= 0);
ATF_REQUIRE(close(fd) == 0);
 }
@@ -82,43 +78,10 @@ prepare_dotdot_tests(void)
 static void
 check_capsicum(void)
 {
-
ATF_REQUIRE_FEATURE("security_capabilities");
ATF_REQUIRE_FEATURE("security_capability_mode");
 }
 
-static void
-run_capsicum_test(child_test_fn_t test_func)
-{
-   int child_exit_code, child_status;
-   pid_t child_pid;
-
-   check_capsicum();
-   prepare_dotdot_tests();
-
-   ATF_REQUIRE_MSG((child_pid = fork()) != -1,
-   "fork failed: %s", strerror(errno));
-
-   if (child_pid == 0) {
-   test_func();
-   _exit(0);
-   }
-
-   ATF_REQUIRE_MSG(waitpid(child_pid, _status, 0) != -1,
-   "waitpid failed: %s", strerror(errno));
-   if (WIFEXITED(child_status)) {
-   child_exit_code = WEXITSTATUS(child_status);
-   ATF_REQUIRE_MSG(child_exit_code == 0,
-   "child exited with non-zero exit code: %d",
-   child_exit_code);
-   } else if (WIFSIGNALED(child_status))
-   atf_tc_fail("child exited with signal: %d",
-   WTERMSIG(child_status));
-   else
-   atf_tc_fail("child exited with unexpected status: %d",
-   child_status);
-}
-
 /*
  * Positive tests
  */
@@ -130,7 +93,6 @@ ATF_TC_HEAD(openat__basic_positive, tc)
 
 ATF_TC_BODY(openat__basic_positive, tc)
 {
-
prepare_dotdot_tests();
 
ATF_REQUIRE(openat(dirfd, "d1/d2/d3/f3", O_RDONLY) >= 0);
@@ -152,22 +114,21 @@ ATF_TC_HEAD(lookup_cap_dotdot__basic, tc
"Validate cap-mode (testdir)/d1/.. lookup");
 }
 
-static void
-lookup_cap_dotdot__basic_child(void)
+ATF_TC_BODY(lookup_cap_dotdot__basic, tc)
 {
cap_rights_t rights;
+   int fd;
 
-   cap_rights_init(, CAP_LOOKUP, CAP_READ);
+   check_capsicum();
+   prepare_dotdot_tests();
 
-   assert(cap_rights_limit(dirfd, ) >= 0);
-   assert(cap_enter() >= 0);
-   assert(openat(dirfd, "d1/..", O_RDONLY) >= 0);
-}
+   cap_rights_init(, CAP_LOOKUP, CAP_READ);
+   ATF_REQUIRE(cap_rights_limit(dirfd, ) >= 0);
 
-ATF_TC_BODY(lookup_cap_dotdot__basic, tc)
-{
+   ATF_REQUIRE(cap_enter() >= 0);
 
-   run_capsicum_test(lookup_cap_dotdot__basic_child);
+   ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s",
+   strerror(errno));
 }
 
 ATF_TC(lookup_cap_dotdot__advanced);
@@ -177,26 +138,23 @@ ATF_TC_HEAD(lookup_cap_dotdot__advanced,
"Validate cap-mode (testdir)/d1/.. lookup");
 }
 
-static void
-lookup_cap_dotdot__advanced_child(void)
+ATF_TC_BODY(lookup_cap_dotdot__advanced, tc)
 {
cap_rights_t rights;
+   int fd;
 
-   cap_rights_init(, CAP_LOOKUP, CAP_READ);
-   assert(cap_rights_limit(dirfd, ) >= 0);
-
-   assert(cap_enter() >= 0);
+   check_capsicum();
+   prepare_dotdot_tests();
 
-   assert(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0);
-   assert(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0);
-   assert(openat(dirfd, "l3/ld1", O_RDONLY) >= 0);
-   assert(openat(dirfd, "l3/lf1", O_RDONLY) >= 0);
-}
+   cap_rights_init(, CAP_LOOKUP, CAP_READ);
+   ATF_REQUIRE(cap_rights_limit(dirfd, ) >= 0);
 
-ATF_TC_BODY(lookup_cap_dotdot__advanced, tc)
-{
+   ATF_REQUIRE(cap_enter() >= 0);
 
-   run_capsicum_test(lookup_cap_dotdot__advanced_child);
+   ATF_REQUIRE(openat(dirfd, "d1/d2/d3/../../f1", O_RDONLY) >= 0);
+   ATF_REQUIRE(openat(dirfd, "l3/../../f1", O_RDONLY) >= 0);
+   ATF_REQUIRE(openat(dirfd, "l3/ld1", O_RDONLY) >= 0);
+   ATF_REQUIRE(openat(dirfd, "l3/lf1", O_RDONLY) >= 0);
 }
 
 /*
@@ -210,7 

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

2017-01-13 Thread Ngie Cooper
Author: ngie
Date: Sat Jan 14 01:01:02 2017
New Revision: 312102
URL: https://svnweb.freebsd.org/changeset/base/312102

Log:
  Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD
  
  MFC after:12 days
  X-MFC with:   r305358
  Sponsored by: Dell EMC Isilon

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

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
==
--- head/contrib/netbsd-tests/lib/libc/gen/t_sleep.cSat Jan 14 00:39:58 
2017(r312101)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_sleep.cSat Jan 14 01:01:02 
2017(r312102)
@@ -27,6 +27,7 @@
  */
 
 #ifdef __FreeBSD__
+/* kqueue(2) on FreeBSD requires sys/types.h for uintptr_t; NetBSD doesn't. */
 #include 
 #endif
 #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"


Re: svn commit: r310994 - head/tests/sys/vfs

2017-01-13 Thread Ngie Cooper (yaneurabeya)

> On Jan 13, 2017, at 16:09, Conrad Meyer  wrote:
> 
> Um, this is garbage and ruins the entire point of using a standardized
> framework like ATF.  Please revert it.
> 
> Instead, just have the Kyua framework preopen its output files before
> running tests.  The diff will be an order of magnitude smaller than
> this one is and it will fix the problem generally instead of adding
> fork/wait cruft and undetailed assert()s to every test.

If you know how to fix it to work with kyua and make it work more optimally, 
please be my guest.
Thanks,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r310994 - head/tests/sys/vfs

2017-01-13 Thread Conrad Meyer
Um, this is garbage and ruins the entire point of using a standardized
framework like ATF.  Please revert it.

Instead, just have the Kyua framework preopen its output files before
running tests.  The diff will be an order of magnitude smaller than
this one is and it will fix the problem generally instead of adding
fork/wait cruft and undetailed assert()s to every test.

Conrad

On Sat, Dec 31, 2016 at 8:01 PM, Ngie Cooper  wrote:
> Author: ngie
> Date: Sun Jan  1 04:01:27 2017
> New Revision: 310994
> URL: https://svnweb.freebsd.org/changeset/base/310994
>
> Log:
>   Make sys/vfs/lookup_cap_dotdot actually work with "kyua test"
>
>   The tests don't work when reading/writing to file descriptors in the
>   sandbox after entering capability mode (and wouldn't have, regardless
>   of the framework), so adjust the tests so they function within the
>   framework.
>
>   For tests that enter capability mode over the course of the test, the
>   following is now done:
>
> 1. Fork child process for capability mode test.
> 2. In child...
>i.   Enter capability mode.
>ii.  Test invariants.
>iii. Exit after calling test function.
> 3. Collect status for child and determine whether or not it completed
>successfully.
>
>   In order to test the invariants in the child process, they now use assert(3)
>   instead of ATF_REQUIRE*, as the atf-c-api functions right to results files
>   in the directories in order to determine where and how tests fail.
>
>   While in the area, fix several -Wshadow and -Wunused warnings found when I
>   bumped WARNS up to 6, and fix some minor style(9) issues with indentation
>   and type alignment.
>
>   PR:   215690
>
> Modified:
>   head/tests/sys/vfs/lookup_cap_dotdot.c
>
> Modified: head/tests/sys/vfs/lookup_cap_dotdot.c
> ==
> --- head/tests/sys/vfs/lookup_cap_dotdot.c  Sun Jan  1 00:43:20 2017  
>   (r310993)
> +++ head/tests/sys/vfs/lookup_cap_dotdot.c  Sun Jan  1 04:01:27 2017  
>   (r310994)
> @@ -31,23 +31,27 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
>
>  #include "freebsd_test_suite/macros.h"
>
> -static int dirfd = -1;
> -static char *abspath;
> +static char*abspath;
> +static int dirfd = -1;
> +
> +typedefvoid (*child_test_fn_t)(void);
>
>  static void
> -touchat(int dirfd, const char *name)
> +touchat(int _dirfd, const char *name)
>  {
> int fd;
>
> -   ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
> +   ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
> 0777)) >= 0);
> ATF_REQUIRE(close(fd) == 0);
>  }
> @@ -78,10 +82,43 @@ prepare_dotdot_tests(void)
>  static void
>  check_capsicum(void)
>  {
> +
> ATF_REQUIRE_FEATURE("security_capabilities");
> ATF_REQUIRE_FEATURE("security_capability_mode");
>  }
>
> +static void
> +run_capsicum_test(child_test_fn_t test_func)
> +{
> +   int child_exit_code, child_status;
> +   pid_t child_pid;
> +
> +   check_capsicum();
> +   prepare_dotdot_tests();
> +
> +   ATF_REQUIRE_MSG((child_pid = fork()) != -1,
> +   "fork failed: %s", strerror(errno));
> +
> +   if (child_pid == 0) {
> +   test_func();
> +   _exit(0);
> +   }
> +
> +   ATF_REQUIRE_MSG(waitpid(child_pid, _status, 0) != -1,
> +   "waitpid failed: %s", strerror(errno));
> +   if (WIFEXITED(child_status)) {
> +   child_exit_code = WEXITSTATUS(child_status);
> +   ATF_REQUIRE_MSG(child_exit_code == 0,
> +   "child exited with non-zero exit code: %d",
> +   child_exit_code);
> +   } else if (WIFSIGNALED(child_status))
> +   atf_tc_fail("child exited with signal: %d",
> +   WTERMSIG(child_status));
> +   else
> +   atf_tc_fail("child exited with unexpected status: %d",
> +   child_status);
> +}
> +
>  /*
>   * Positive tests
>   */
> @@ -93,6 +130,7 @@ ATF_TC_HEAD(openat__basic_positive, tc)
>
>  ATF_TC_BODY(openat__basic_positive, tc)
>  {
> +
> prepare_dotdot_tests();
>
> ATF_REQUIRE(openat(dirfd, "d1/d2/d3/f3", O_RDONLY) >= 0);
> @@ -114,21 +152,22 @@ ATF_TC_HEAD(lookup_cap_dotdot__basic, tc
> "Validate cap-mode (testdir)/d1/.. lookup");
>  }
>
> -ATF_TC_BODY(lookup_cap_dotdot__basic, tc)
> +static void
> +lookup_cap_dotdot__basic_child(void)
>  {
> cap_rights_t rights;
> -   int fd;
> -
> -   check_capsicum();
> -   prepare_dotdot_tests();
>
> cap_rights_init(, CAP_LOOKUP, CAP_READ);
> -   ATF_REQUIRE(cap_rights_limit(dirfd, ) >= 0);
>
> -   ATF_REQUIRE(cap_enter() >= 0);
> +   assert(cap_rights_limit(dirfd, ) >= 0);
> +   assert(cap_enter() >= 0);
> +   

svn commit: r312087 - in head/sys: kern sys

2017-01-13 Thread Gleb Smirnoff
Author: glebius
Date: Fri Jan 13 22:16:41 2017
New Revision: 312087
URL: https://svnweb.freebsd.org/changeset/base/312087

Log:
  Remove deprecated fgetsock() and fputsock().

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/sys/file.h
  head/sys/sys/param.h

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cFri Jan 13 21:52:53 2017
(r312086)
+++ head/sys/kern/kern_descrip.cFri Jan 13 22:16:41 2017
(r312087)
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -2840,61 +2839,6 @@ fgetvp_write(struct thread *td, int fd, 
 #endif
 
 /*
- * Like fget() but loads the underlying socket, or returns an error if the
- * descriptor does not represent a socket.
- *
- * We bump the ref count on the returned socket.  XXX Also obtain the SX lock
- * in the future.
- *
- * Note: fgetsock() and fputsock() are deprecated, as consumers should rely
- * on their file descriptor reference to prevent the socket from being free'd
- * during use.
- */
-int
-fgetsock(struct thread *td, int fd, cap_rights_t *rightsp, struct socket **spp,
-u_int *fflagp)
-{
-   struct file *fp;
-   int error;
-
-   *spp = NULL;
-   if (fflagp != NULL)
-   *fflagp = 0;
-   if ((error = _fget(td, fd, , 0, rightsp, NULL)) != 0)
-   return (error);
-   if (fp->f_type != DTYPE_SOCKET) {
-   error = ENOTSOCK;
-   } else {
-   *spp = fp->f_data;
-   if (fflagp)
-   *fflagp = fp->f_flag;
-   SOCK_LOCK(*spp);
-   soref(*spp);
-   SOCK_UNLOCK(*spp);
-   }
-   fdrop(fp, td);
-
-   return (error);
-}
-
-/*
- * Drop the reference count on the socket and XXX release the SX lock in the
- * future.  The last reference closes the socket.
- *
- * Note: fputsock() is deprecated, see comment for fgetsock().
- */
-void
-fputsock(struct socket *so)
-{
-
-   ACCEPT_LOCK();
-   SOCK_LOCK(so);
-   CURVNET_SET(so->so_vnet);
-   sorele(so);
-   CURVNET_RESTORE();
-}
-
-/*
  * Handle the last reference to a file being closed.
  */
 int

Modified: head/sys/sys/file.h
==
--- head/sys/sys/file.h Fri Jan 13 21:52:53 2017(r312086)
+++ head/sys/sys/file.h Fri Jan 13 22:16:41 2017(r312087)
@@ -50,8 +50,6 @@ struct thread;
 struct uio;
 struct knote;
 struct vnode;
-struct socket;
-
 
 #endif /* _KERNEL */
 
@@ -267,10 +265,6 @@ int fgetvp_read(struct thread *td, int f
 int fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp,
 struct vnode **vpp);
 
-int fgetsock(struct thread *td, int fd, cap_rights_t *rightsp,
-struct socket **spp, u_int *fflagp);
-void fputsock(struct socket *sp);
-
 static __inline int
 _fnoop(void)
 {

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hFri Jan 13 21:52:53 2017(r312086)
+++ head/sys/sys/param.hFri Jan 13 22:16:41 2017(r312087)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200019  /* Master, propagated to newvers */
+#define __FreeBSD_version 1200020  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
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: r312086 - in head/sys: mips/mips sparc64/sparc64

2017-01-13 Thread John Baldwin
Author: jhb
Date: Fri Jan 13 21:52:53 2017
New Revision: 312086
URL: https://svnweb.freebsd.org/changeset/base/312086

Log:
  Trim a few comments on platforms that did not implement mmap of /dev/kmem.
  
  After r307332, no platforms implement mmap for /dev/kmem, so the lack of
  it for these platforms is no longer unique.

Modified:
  head/sys/mips/mips/mem.c
  head/sys/sparc64/sparc64/mem.c

Modified: head/sys/mips/mips/mem.c
==
--- head/sys/mips/mips/mem.cFri Jan 13 21:42:36 2017(r312085)
+++ head/sys/mips/mips/mem.cFri Jan 13 21:52:53 2017(r312086)
@@ -151,12 +151,6 @@ int
 memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
 int prot, vm_memattr_t *memattr)
 {
-   /*
-* /dev/mem is the only one that makes sense through this
-* interface.  For /dev/kmem any physaddr we return here
-* could be transient and hence incorrect or invalid at
-* a later time.
-*/
if (dev2unit(dev) != CDEV_MINOR_MEM)
return (-1);
 

Modified: head/sys/sparc64/sparc64/mem.c
==
--- head/sys/sparc64/sparc64/mem.c  Fri Jan 13 21:42:36 2017
(r312085)
+++ head/sys/sparc64/sparc64/mem.c  Fri Jan 13 21:52:53 2017
(r312086)
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
 /*
  * Memory special file
  *
- * NOTE: other architectures support mmap()'ing the mem and kmem devices; this
+ * NOTE: other architectures support mmap()'ing the mem device; this
  * might cause illegal aliases to be created for the locked kernel page(s), so
  * it is not implemented.
  */
___
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: r312083 - head/lib/libc/sys

2017-01-13 Thread Warren Block
Author: wblock (doc committer)
Date: Fri Jan 13 19:41:02 2017
New Revision: 312083
URL: https://svnweb.freebsd.org/changeset/base/312083

Log:
  Update the shm_open.2 man page to reflect objective reality.
  
  PR:   215612
  Submitted by: rwatson
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9066

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

Modified: head/lib/libc/sys/shm_open.2
==
--- head/lib/libc/sys/shm_open.2Fri Jan 13 19:22:22 2017
(r312082)
+++ head/lib/libc/sys/shm_open.2Fri Jan 13 19:41:02 2017
(r312083)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 18, 2013
+.Dd January 13, 2017
 .Dt SHM_OPEN 2
 .Os
 .Sh NAME
@@ -171,7 +171,8 @@ and
 .Dv O_TRUNC
 flags may be used in portable programs.
 .Pp
-The result of using
+.Tn POSIX
+specifications state that the result of using
 .Xr open 2 ,
 .Xr read 2 ,
 or
@@ -179,19 +180,43 @@ or
 on a shared memory object, or on the descriptor returned by
 .Fn shm_open ,
 is undefined.
-It is also undefined whether the shared memory object itself, or its
-contents, persist across reboots.
-.Pp
-In FreeBSD,
+However, the
+.Fx
+kernel implementation explicitly includes support for
 .Xr read 2
 and
-.Xr write 2
-on a shared memory object will fail with
-.Er EOPNOTSUPP
-and neither shared memory objects nor their contents persist across reboots.
+.Xr write 2 .
+.Pp
+Neither shared memory objects nor their contents persist across reboots.
+.Pp
+Writes do not extend shared memory objects, so
+.Xr ftruncate 2
+must be called before any data can be written.
+See
+.Sx EXAMPLES .
+.Sh EXAMPLES
+This example fails without the call to
+.Xr ftruncate 2 :
+.Bd -literal -compact
+
+uint8_t buffer[getpagesize()];
+ssize_t len;
+int fd;
+
+fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600);
+if (fd < 0)
+err(EX_OSERR, "%s: shm_open", __func__);
+if (ftruncate(fd, getpagesize()) < 0)
+err(EX_IOERR, "%s: ftruncate", __func__);
+len = pwrite(fd, buffer, getpagesize(), 0);
+if (len < 0)
+err(EX_IOERR, "%s: pwrite", __func__);
+if (len != getpagesize())
+errx(EX_IOERR, "%s: pwrite length mismatch", __func__);
+.Ed
 .Sh ERRORS
-The following errors are defined for
-.Fn shm_open :
+.Fn shm_open
+fails with these error codes for these conditions:
 .Bl -tag -width Er
 .It Bq Er EINVAL
 A flag other than
@@ -235,8 +260,8 @@ are specified and the named shared memor
 The required permissions (for reading or reading and writing) are denied.
 .El
 .Pp
-The following errors are defined for
-.Fn shm_unlink :
+.Fn shm_unlink
+fails with these error codes for these conditions:
 .Bl -tag -width Er
 .It Bq Er EFAULT
 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: r312081 - head/sys/dev/iscsi_initiator

2017-01-13 Thread Gleb Smirnoff
Author: glebius
Date: Fri Jan 13 18:36:46 2017
New Revision: 312081
URL: https://svnweb.freebsd.org/changeset/base/312081

Log:
  Use getsock_cap() instead of deprecated fgetsock().
  
  Reviewed by:  Daniel Braniss 

Modified:
  head/sys/dev/iscsi_initiator/isc_soc.c
  head/sys/dev/iscsi_initiator/iscsi.c

Modified: head/sys/dev/iscsi_initiator/isc_soc.c
==
--- head/sys/dev/iscsi_initiator/isc_soc.c  Fri Jan 13 17:03:23 2017
(r312080)
+++ head/sys/dev/iscsi_initiator/isc_soc.c  Fri Jan 13 18:36:46 2017
(r312081)
@@ -680,7 +680,6 @@ isc_stop_receiver(isc_session_t *sp)
 
  if(sp->fp != NULL)
  fdrop(sp->fp, sp->td);
- fputsock(sp->soc);
  sp->soc = NULL;
  sp->fp = NULL;
 

Modified: head/sys/dev/iscsi_initiator/iscsi.c
==
--- head/sys/dev/iscsi_initiator/iscsi.cFri Jan 13 17:03:23 2017
(r312080)
+++ head/sys/dev/iscsi_initiator/iscsi.cFri Jan 13 18:36:46 2017
(r312081)
@@ -388,20 +388,14 @@ i_setsoc(isc_session_t *sp, int fd, stru
  if(sp->soc != NULL)
  isc_stop_receiver(sp);
 
- error = fget(td, fd, cap_rights_init(, CAP_SOCK_CLIENT), >fp);
+ error = getsock_cap(td, fd, cap_rights_init(, CAP_SOCK_CLIENT),
+>fp, NULL, NULL);
  if(error)
  return error;
 
- error = fgetsock(td, fd, cap_rights_init(, CAP_SOCK_CLIENT),
->soc, 0);
- if(error == 0) {
- sp->td = td;
- isc_start_receiver(sp);
- }
- else {
- fdrop(sp->fp, td);
- sp->fp = NULL;
- }
+ sp->soc = sp->fp->f_data;
+ sp->td = td;
+ isc_start_receiver(sp);
 
  return 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: r312080 - head/sys/kern

2017-01-13 Thread Ian Lepore
Author: ian
Date: Fri Jan 13 17:03:23 2017
New Revision: 312080
URL: https://svnweb.freebsd.org/changeset/base/312080

Log:
  Correct the comments about how much buffer is allocated.

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==
--- head/sys/kern/tty.c Fri Jan 13 16:54:44 2017(r312079)
+++ head/sys/kern/tty.c Fri Jan 13 17:03:23 2017(r312080)
@@ -117,7 +117,7 @@ tty_watermarks(struct tty *tp)
size_t bs = 0;
int error;
 
-   /* Provide an input buffer for 0.2 seconds of data. */
+   /* Provide an input buffer for 2 seconds of data. */
if (tp->t_termios.c_cflag & CREAD)
bs = MIN(tp->t_termios.c_ispeed / 5, TTYBUF_MAX);
error = ttyinq_setsize(>t_inq, tp, bs);
@@ -127,7 +127,7 @@ tty_watermarks(struct tty *tp)
/* Set low watermark at 10% (when 90% is available). */
tp->t_inlow = (ttyinq_getallocatedsize(>t_inq) * 9) / 10;
 
-   /* Provide an output buffer for 0.2 seconds of data. */
+   /* Provide an output buffer for 2 seconds of data. */
bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX);
error = ttyoutq_setsize(>t_outq, tp, bs);
if (error != 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: r312079 - head/sys/netinet

2017-01-13 Thread Gleb Smirnoff
Author: glebius
Date: Fri Jan 13 16:54:44 2017
New Revision: 312079
URL: https://svnweb.freebsd.org/changeset/base/312079

Log:
  Use getsock_cap() instead of deprecated fgetsock().
  
  Reviewed by:  tuexen

Modified:
  head/sys/netinet/sctp_syscalls.c

Modified: head/sys/netinet/sctp_syscalls.c
==
--- head/sys/netinet/sctp_syscalls.cFri Jan 13 16:46:01 2017
(r312078)
+++ head/sys/netinet/sctp_syscalls.cFri Jan 13 16:54:44 2017
(r312079)
@@ -121,17 +121,18 @@ sys_sctp_peeloff(td, uap)
} */ *uap;
 {
 #if (defined(INET) || defined(INET6)) && defined(SCTP)
-   struct file *nfp = NULL;
+   struct file *headfp, *nfp = NULL;
struct socket *head, *so;
cap_rights_t rights;
u_int fflag;
int error, fd;
 
AUDIT_ARG_FD(uap->sd);
-   error = fgetsock(td, uap->sd, cap_rights_init(, CAP_PEELOFF),
-   , );
+   error = getsock_cap(td, uap->sd, cap_rights_init(, CAP_PEELOFF),
+   , , NULL);
if (error != 0)
goto done2;
+   head = headfp->f_data;
if (head->so_proto->pr_protocol != IPPROTO_SCTP) {
error = EOPNOTSUPP;
goto done;
@@ -196,7 +197,7 @@ noconnection:
 done:
if (nfp != NULL)
fdrop(nfp, td);
-   fputsock(head);
+   fdrop(headfp, td);
 done2:
return (error);
 #else  /* SCTP */
___
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: r312078 - head/usr.sbin/fstyp

2017-01-13 Thread Conrad E. Meyer
Author: cem
Date: Fri Jan 13 16:46:01 2017
New Revision: 312078
URL: https://svnweb.freebsd.org/changeset/base/312078

Log:
  fstyp.8: Move initial exFAT blurb to the -u section
  
  Didn't notice the second list in r312003.
  
  Reported by:  trasz@

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

Modified: head/usr.sbin/fstyp/fstyp.8
==
--- head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 16:37:38 2017(r312077)
+++ head/usr.sbin/fstyp/fstyp.8 Fri Jan 13 16:46:01 2017(r312078)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 12, 2017
+.Dd January 13, 2017
 .Dt FSTYP 8
 .Os
 .Sh NAME
@@ -43,7 +43,7 @@
 The
 .Nm
 utility is used to determine the filesystem type on a given device.
-It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS filesystems.
+It can recognize ISO-9660, Ext2, FAT, NTFS, and UFS filesystems.
 When the
 .Fl u
 flag is specified,
@@ -51,9 +51,10 @@ flag is specified,
 also recognizes certain additional metadata formats that cannot be
 handled using
 .Xr mount 8 ,
-such as ZFS pools and
+such as exFAT filesystems,
 .Xr geli 8
-providers.
+providers, and
+ZFS pools.
 .Pp
 The filesystem name is printed to the standard output
 as, respectively:
___
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: r312077 - in head/sys: kern sys

2017-01-13 Thread Ian Lepore
Author: ian
Date: Fri Jan 13 16:37:38 2017
New Revision: 312077
URL: https://svnweb.freebsd.org/changeset/base/312077

Log:
  Check tty_gone() after allocating IO buffers.  The tty lock has to be
  dropped then reacquired due to using M_WAITOK, which opens a window in
  which the tty device can disappear.  Check for this and return ENXIO
  back up the call chain so that callers can cope.
  
  This closes a race where TF_GONE would get set while buffers were being
  allocated as part of ttydev_open(), causing a subsequent call to
  ttydevsw_modem() later in ttydev_open() to assert.
  
  Reported by:  pho
  Reviewed by:  kib

Modified:
  head/sys/kern/tty.c
  head/sys/kern/tty_inq.c
  head/sys/kern/tty_outq.c
  head/sys/sys/ttyqueue.h

Modified: head/sys/kern/tty.c
==
--- head/sys/kern/tty.c Fri Jan 13 15:17:25 2017(r312076)
+++ head/sys/kern/tty.c Fri Jan 13 16:37:38 2017(r312077)
@@ -105,25 +105,38 @@ SYSCTL_INT(_kern, OID_AUTO, tty_drainwai
 
 #defineTTYBUF_MAX  65536
 
-static void
+/*
+ * Allocate buffer space if necessary, and set low watermarks, based on speed.
+ * Note that the ttyxxxq_setsize() functions may drop and then reacquire the 
tty
+ * lock during memory allocation.  They will return ENXIO if the tty disappears
+ * while unlocked.
+ */
+static int
 tty_watermarks(struct tty *tp)
 {
size_t bs = 0;
+   int error;
 
/* Provide an input buffer for 0.2 seconds of data. */
if (tp->t_termios.c_cflag & CREAD)
bs = MIN(tp->t_termios.c_ispeed / 5, TTYBUF_MAX);
-   ttyinq_setsize(>t_inq, tp, bs);
+   error = ttyinq_setsize(>t_inq, tp, bs);
+   if (error != 0)
+   return (error);
 
/* Set low watermark at 10% (when 90% is available). */
tp->t_inlow = (ttyinq_getallocatedsize(>t_inq) * 9) / 10;
 
/* Provide an output buffer for 0.2 seconds of data. */
bs = MIN(tp->t_termios.c_ospeed / 5, TTYBUF_MAX);
-   ttyoutq_setsize(>t_outq, tp, bs);
+   error = ttyoutq_setsize(>t_outq, tp, bs);
+   if (error != 0)
+   return (error);
 
/* Set low watermark at 10% (when 90% is available). */
tp->t_outlow = (ttyoutq_getallocatedsize(>t_outq) * 9) / 10;
+
+   return (0);
 }
 
 static int
@@ -318,7 +331,9 @@ ttydev_open(struct cdev *dev, int oflags
goto done;
 
ttydisc_open(tp);
-   tty_watermarks(tp); /* XXXGL: drops lock */
+   error = tty_watermarks(tp);
+   if (error != 0)
+   goto done;
}
 
/* Wait for Carrier Detect. */
@@ -1627,7 +1642,9 @@ tty_generic_ioctl(struct tty *tp, u_long
tp->t_termios.c_ospeed = t->c_ospeed;
 
/* Baud rate has changed - update watermarks. */
-   tty_watermarks(tp);
+   error = tty_watermarks(tp);
+   if (error)
+   return (error);
}
 
/* Copy new non-device driver parameters. */

Modified: head/sys/kern/tty_inq.c
==
--- head/sys/kern/tty_inq.c Fri Jan 13 15:17:25 2017(r312076)
+++ head/sys/kern/tty_inq.c Fri Jan 13 16:37:38 2017(r312077)
@@ -112,7 +112,7 @@ static uma_zone_t ttyinq_zone;
TTYINQ_INSERT_TAIL(ti, tib);\
 } while (0)
 
-void
+int 
 ttyinq_setsize(struct ttyinq *ti, struct tty *tp, size_t size)
 {
struct ttyinq_block *tib;
@@ -134,8 +134,14 @@ ttyinq_setsize(struct ttyinq *ti, struct
tib = uma_zalloc(ttyinq_zone, M_WAITOK);
tty_lock(tp);
 
+   if (tty_gone(tp)) {
+   uma_zfree(ttyinq_zone, tib);
+   return (ENXIO);
+   }
+
TTYINQ_INSERT_TAIL(ti, tib);
}
+   return (0);
 }
 
 void

Modified: head/sys/kern/tty_outq.c
==
--- head/sys/kern/tty_outq.cFri Jan 13 15:17:25 2017(r312076)
+++ head/sys/kern/tty_outq.cFri Jan 13 16:37:38 2017(r312077)
@@ -89,7 +89,7 @@ ttyoutq_flush(struct ttyoutq *to)
to->to_end = 0;
 }
 
-void
+int
 ttyoutq_setsize(struct ttyoutq *to, struct tty *tp, size_t size)
 {
struct ttyoutq_block *tob;
@@ -111,8 +111,14 @@ ttyoutq_setsize(struct ttyoutq *to, stru
tob = uma_zalloc(ttyoutq_zone, M_WAITOK);
tty_lock(tp);
 
+   if (tty_gone(tp)) {
+   uma_zfree(ttyoutq_zone, tob);
+   return (ENXIO);
+   }
+
TTYOUTQ_INSERT_TAIL(to, tob);
}
+   return (0);
 }
 
 void

Modified: head/sys/sys/ttyqueue.h

svn commit: r312076 - head/lib/libgcc_s

2017-01-13 Thread Ed Maste
Author: emaste
Date: Fri Jan 13 15:17:25 2017
New Revision: 312076
URL: https://svnweb.freebsd.org/changeset/base/312076

Log:
  libgcc_s: add libc DT_NEEDED to fix underlinking
  
  PR:   216012
  Reported by:  jbeich
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libgcc_s/Makefile

Modified: head/lib/libgcc_s/Makefile
==
--- head/lib/libgcc_s/Makefile  Fri Jan 13 13:50:44 2017(r312075)
+++ head/lib/libgcc_s/Makefile  Fri Jan 13 15:17:25 2017(r312076)
@@ -8,6 +8,7 @@ MK_SSP= no
 WARNS?=2
 
 LDFLAGS+=  -nodefaultlibs
+LIBADD+=   c
 VERSION_MAP=   ${.CURDIR}/Version.map
 
 .include "../libcompiler_rt/Makefile.inc"
___
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: r286649 - in head: contrib/netbsd-tests/lib/libc/locale lib/libc/tests/locale

2017-01-13 Thread Jilles Tjoelker
On Wed, Jan 11, 2017 at 02:14:13AM -0800, Ngie Cooper (yaneurabeya) wrote:

> > On Aug 11, 2015, at 6:45 PM, Craig Rodrigues  wrote:
> > 
> > On Tue, Aug 11, 2015 at 2:59 PM, Jilles Tjoelker  > > wrote:
> > Author: jilles
> > Date: Tue Aug 11 21:59:36 2015
> > New Revision: 286649
> > URL: https://svnweb.freebsd.org/changeset/base/286649 
> > 

> > Log:
> >   Fix and re-enable UTF-8 tests.

> > Modified:
> >   head/contrib/netbsd-tests/lib/libc/locale/t_mbrtowc.c
> >   head/contrib/netbsd-tests/lib/libc/locale/t_mbstowcs.c
> >   head/lib/libc/tests/locale/Makefile

> > Thanks for fixing this.  What is the procedure that FreeBSD
> > developers need to follow to push this kind of change upstream to
> > NetBSD?

>   I’m submitting PRs with NetBSD as needed. To be frank, I’m not
> sure that this change is needed upstream (I’m probably going to #ifdef
> the code — some things I found when trying to push things back).

I think the change is required upstream as well, since UTF-8 no longer
includes code points greater than 0x10 per RFC 3629 (this change
made the code point ranges of UTF-8 and UTF-16 the same). The sequences
that used to correspond to code points greater than 0x10 shall be
treated as invalid. See also SVN r286490, r286491, r287125.

I suppose I should have included this reasoning in the original commit
message.

-- 
Jilles Tjoelker
___
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: r312063 - head/sys/netinet

2017-01-13 Thread Michael Tuexen
Author: tuexen
Date: Fri Jan 13 10:55:26 2017
New Revision: 312063
URL: https://svnweb.freebsd.org/changeset/base/312063

Log:
  Ensure that the buffer length and the length provided in the IPv4
  header match when using a raw socket to send IPv4 packets and
  providing the header. If they don't match, let send return -1
  and set errno to EINVAL.
  
  Before this patch is was only enforced that the length in the header
  is not larger then the buffer length.
  
  PR:   212283
  Reviewed by:  ae, gnn
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9161

Modified:
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/raw_ip.c
==
--- head/sys/netinet/raw_ip.c   Fri Jan 13 10:28:26 2017(r312062)
+++ head/sys/netinet/raw_ip.c   Fri Jan 13 10:55:26 2017(r312063)
@@ -508,7 +508,7 @@ rip_output(struct mbuf *m, struct socket
 * and don't allow packet length sizes that will crash.
 */
if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options)
-   || (ntohs(ip->ip_len) > m->m_pkthdr.len)
+   || (ntohs(ip->ip_len) != m->m_pkthdr.len)
|| (ntohs(ip->ip_len) < (ip->ip_hl << 2))) {
INP_RUNLOCK(inp);
m_freem(m);
___
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: r304218 - head/sys/netinet

2017-01-13 Thread Julien Charbon

 Hi,

On 8/16/16 3:21 PM, Randall Stewart via svn-src-all wrote:
> 
> In theory it *could* be MFC’d to stable-10 and 11 but I am not sure we want 
> to do that. I am
> told by Drew that it does improve performance since in stable-10 you are 
> getting the INFO_WLOCK()
> but I am not sure if folks want it MFC’d…
> 
> R

 A bit late in the game but for information:  Since r309108,in
stable-10 you are getting the INFO_RLOCK instead of the INFO_WLOCK like
in stable-11 and HEAD:

https://svnweb.freebsd.org/base?view=revision=309108

 In summary the same TCP INP_INFO lock logic is used in stable-10, 11
and HEAD which simplify MFC if needed.

 My 2 cents.

--
Julien



signature.asc
Description: OpenPGP digital signature


svn commit: r312026 - in head/sys/cam: . ctl scsi

2017-01-13 Thread Alexander Motin
Author: mav
Date: Fri Jan 13 08:31:55 2017
New Revision: 312026
URL: https://svnweb.freebsd.org/changeset/base/312026

Log:
  Improve CAM_CDB_POINTER support.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/cam_ccb.h
  head/sys/cam/cam_periph.c
  head/sys/cam/ctl/ctl_frontend_cam_sim.c
  head/sys/cam/ctl/scsi_ctl.c
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_xpt.c

Modified: head/sys/cam/cam_ccb.h
==
--- head/sys/cam/cam_ccb.h  Fri Jan 13 08:29:43 2017(r312025)
+++ head/sys/cam/cam_ccb.h  Fri Jan 13 08:31:55 2017(r312026)
@@ -784,6 +784,13 @@ struct ccb_accept_tio {
struct scsi_sense_data sense_data;
 };
 
+static __inline uint8_t *
+atio_cdb_ptr(struct ccb_accept_tio *ccb)
+{
+   return ((ccb->ccb_h.flags & CAM_CDB_POINTER) ?
+   ccb->cdb_io.cdb_ptr : ccb->cdb_io.cdb_bytes);
+}
+
 /* Release SIM Queue */
 struct ccb_relsim {
struct ccb_hdr ccb_h;

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Fri Jan 13 08:29:43 2017(r312025)
+++ head/sys/cam/cam_periph.c   Fri Jan 13 08:31:55 2017(r312026)
@@ -1930,10 +1930,7 @@ cam_periph_devctl_notify(union ccb *ccb)
 
if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
sbuf_printf(, "CDB=\"");
-   if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0)
-   scsi_cdb_sbuf(ccb->csio.cdb_io.cdb_ptr, );
-   else
-   scsi_cdb_sbuf(ccb->csio.cdb_io.cdb_bytes, );
+   scsi_cdb_sbuf(scsiio_cdb_ptr(>csio), );
sbuf_printf(, "\" ");
} else if (ccb->ccb_h.func_code == XPT_ATA_IO) {
sbuf_printf(, "ACB=\"");

Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c
==
--- head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Jan 13 08:29:43 2017
(r312025)
+++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Jan 13 08:31:55 2017
(r312026)
@@ -587,8 +587,7 @@ cfcs_action(struct cam_sim *sim, union c
   __func__, csio->cdb_len, sizeof(io->scsiio.cdb));
}
io->scsiio.cdb_len = min(csio->cdb_len, sizeof(io->scsiio.cdb));
-   bcopy(csio->cdb_io.cdb_bytes, io->scsiio.cdb,
- io->scsiio.cdb_len);
+   bcopy(scsiio_cdb_ptr(csio), io->scsiio.cdb, io->scsiio.cdb_len);
 
ccb->ccb_h.status |= CAM_SIM_QUEUED;
err = ctl_queue(io);

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Fri Jan 13 08:29:43 2017(r312025)
+++ head/sys/cam/ctl/scsi_ctl.c Fri Jan 13 08:31:55 2017(r312026)
@@ -941,7 +941,7 @@ ctlfestart(struct cam_periph *periph, un
  && (csio->sglist_cnt != 0))) {
printf("%s: tag %04x cdb %02x flags %#x dxfer_len "
   "%d sg %u\n", __func__, atio->tag_id,
-  atio->cdb_io.cdb_bytes[0], flags, dxfer_len,
+  atio_cdb_ptr(atio)[0], flags, dxfer_len,
   csio->sglist_cnt);
printf("%s: tag %04x io status %#x\n", __func__,
   atio->tag_id, io->io_hdr.status);
@@ -1027,8 +1027,7 @@ ctlfe_adjust_cdb(struct ccb_accept_tio *
 {
uint64_t lba;
uint32_t num_blocks, nbc;
-   uint8_t *cmdbyt = (atio->ccb_h.flags & CAM_CDB_POINTER)?
-   atio->cdb_io.cdb_ptr : atio->cdb_io.cdb_bytes;
+   uint8_t *cmdbyt = atio_cdb_ptr(atio);
 
nbc = offset >> 9;  /* ASSUMING 512 BYTE BLOCKS */
 
@@ -1206,8 +1205,7 @@ ctlfedone(struct cam_periph *periph, uni
   __func__, atio->cdb_len, sizeof(io->scsiio.cdb));
}
io->scsiio.cdb_len = min(atio->cdb_len, sizeof(io->scsiio.cdb));
-   bcopy(atio->cdb_io.cdb_bytes, io->scsiio.cdb,
- io->scsiio.cdb_len);
+   bcopy(atio_cdb_ptr(atio), io->scsiio.cdb, io->scsiio.cdb_len);
 
 #ifdef CTLFEDEBUG
printf("%s: %u:%u:%u: tag %04x CDB %02x\n", __func__,
@@ -1388,7 +1386,7 @@ ctlfedone(struct cam_periph *periph, uni
printf("%s: tag %04x no status or "
   "len cdb = %02x\n", __func__,
   atio->tag_id,
-   atio->cdb_io.cdb_bytes[0]);
+  atio_cdb_ptr(atio)[0]);
printf("%s: tag %04x io status %#x\n",
   __func__, atio->tag_id,
   io->io_hdr.status);

Modified: 

svn commit: r312018 - head/usr.sbin/route6d

2017-01-13 Thread Hiroki Sato
Author: hrs
Date: Fri Jan 13 08:01:27 2017
New Revision: 312018
URL: https://svnweb.freebsd.org/changeset/base/312018

Log:
  Purge varargs.h in favor of stdarg.h.

Modified:
  head/usr.sbin/route6d/route6d.c

Modified: head/usr.sbin/route6d/route6d.c
==
--- head/usr.sbin/route6d/route6d.c Fri Jan 13 07:24:58 2017
(r312017)
+++ head/usr.sbin/route6d/route6d.c Fri Jan 13 08:01:27 2017
(r312018)
@@ -57,11 +57,7 @@ static const char _rcsid[] = "$KAME: rou
 #endif
 #include 
 #include 
-#ifdef __STDC__
 #include 
-#else
-#include 
-#endif
 #include 
 #include 
 #include 
@@ -203,7 +199,6 @@ static volatile sig_atomic_t seenusr1;
 #define RRTF_SENDANYWAY0x4000
 #defineRRTF_CHANGED0x8000
 
-int main(int, char **);
 static void sighandler(int);
 static void ripalarm(void);
 static void riprecv(void);
@@ -3457,22 +3452,12 @@ ripsuptrig(void)
 #endif
 
 static void
-#ifdef __STDC__
 fatal(const char *fmt, ...)
-#else
-fatal(fmt, va_alist)
-   char*fmt;
-   va_dcl
-#endif
 {
va_list ap;
char buf[1024];
 
-#ifdef __STDC__
va_start(ap, fmt);
-#else
-   va_start(ap);
-#endif
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
perror(buf);
@@ -3484,33 +3469,18 @@ fatal(fmt, va_alist)
 }
 
 static void
-#ifdef __STDC__
 tracet(int level, const char *fmt, ...)
-#else
-tracet(level, fmt, va_alist)
-   int level;
-   char *fmt;
-   va_dcl
-#endif
 {
va_list ap;
 
if (level <= dflag) {
-#ifdef __STDC__
va_start(ap, fmt);
-#else
-   va_start(ap);
-#endif
fprintf(stderr, "%s: ", hms());
vfprintf(stderr, fmt, ap);
va_end(ap);
}
if (dflag) {
-#ifdef __STDC__
va_start(ap, fmt);
-#else
-   va_start(ap);
-#endif
if (level > 0)
vsyslog(LOG_DEBUG, fmt, ap);
else
@@ -3520,32 +3490,17 @@ tracet(level, fmt, va_alist)
 }
 
 static void
-#ifdef __STDC__
 trace(int level, const char *fmt, ...)
-#else
-trace(level, fmt, va_alist)
-   int level;
-   char *fmt;
-   va_dcl
-#endif
 {
va_list ap;
 
if (level <= dflag) {
-#ifdef __STDC__
va_start(ap, fmt);
-#else
-   va_start(ap);
-#endif
vfprintf(stderr, fmt, ap);
va_end(ap);
}
if (dflag) {
-#ifdef __STDC__
va_start(ap, fmt);
-#else
-   va_start(ap);
-#endif
if (level > 0)
vsyslog(LOG_DEBUG, fmt, ap);
else
___
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"