svn commit: r204819 - in head: bin/setfacl lib/libc/posix1e

2010-03-07 Thread Joel Dahl
Author: joel (doc committer)
Date: Sun Mar  7 07:59:05 2010
New Revision: 204819
URL: http://svn.freebsd.org/changeset/base/204819

Log:
  Switch to our preferred license text.
  
  Approved by:  jedgar

Modified:
  head/bin/setfacl/file.c
  head/bin/setfacl/mask.c
  head/bin/setfacl/merge.c
  head/bin/setfacl/remove.c
  head/bin/setfacl/setfacl.1
  head/bin/setfacl/setfacl.c
  head/bin/setfacl/setfacl.h
  head/bin/setfacl/util.c
  head/lib/libc/posix1e/acl_strip.c

Modified: head/bin/setfacl/file.c
==
--- head/bin/setfacl/file.c Sun Mar  7 04:26:21 2010(r204818)
+++ head/bin/setfacl/file.c Sun Mar  7 07:59:05 2010(r204819)
@@ -14,14 +14,14 @@
  * 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
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD 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.
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR 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.
  */
 
 #include sys/cdefs.h

Modified: head/bin/setfacl/mask.c
==
--- head/bin/setfacl/mask.c Sun Mar  7 04:26:21 2010(r204818)
+++ head/bin/setfacl/mask.c Sun Mar  7 07:59:05 2010(r204819)
@@ -14,14 +14,14 @@
  * 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
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD 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.
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR 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.
  */
 
 #include sys/cdefs.h

Modified: head/bin/setfacl/merge.c
==
--- head/bin/setfacl/merge.cSun Mar  7 04:26:21 2010(r204818)
+++ head/bin/setfacl/merge.cSun Mar  7 07:59:05 2010(r204819)
@@ -14,14 +14,14 @@
  * 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
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD 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.
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 

svn commit: r204821 - head/etc

2010-03-07 Thread Ed Schouten
Author: ed
Date: Sun Mar  7 08:54:06 2010
New Revision: 204821
URL: http://svn.freebsd.org/changeset/base/204821

Log:
  Improve the contents of termcap.small.
  
  - Remove dosansi, pc and pc3. I suspect nobody ever needs these.
  - Add vt100, screen and xterm-color.
  
  This file is now probably more than sufficient in most cases, even for
  common use outside single user mode, where people just use the console
  driver, a graphical terminal emulator and a terminal multiplexer.

Modified:
  head/etc/termcap.small

Modified: head/etc/termcap.small
==
--- head/etc/termcap.small  Sun Mar  7 08:30:21 2010(r204820)
+++ head/etc/termcap.small  Sun Mar  7 08:54:06 2010(r204821)
@@ -203,93 +203,46 @@ cons60l7|cons60-iso8859-7:\
:li#60:tc=cons25l7:
 cons60l7-m|cons60-iso8859-7-mono:\
:li#60:tc=cons25l7-m:
-#
-dosansi|ANSI.SYS standard crt:\
-   :am:bs:ce=\E[K:cl=\E[2J:cm=\E[%i%d;%dH:co#80:\
-   :do=\E[B:li#25:mi:nd=\E[C:\
-   :se=\E[m:so=\E[7m:up=\E[A:us=\E[4m:ue=\E[m:\
-   :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
-   :kh=\EG:kb=^h:ku=\EH:kd=\EP:kl=\EK:kr=\EM:\
-   :k1=\E;:k2=\E:k3=\E=:k4=\E:k5=\E?:\
-   :k6=\E@:k7=\EA:k8=\EB:k9=\EC:k0=\ED:
 
-# The following is a version of the ibm-pc entry distributed with PC/IX,
-# (Interactive Systems' System 3 for the Big Blue), modified by Richard
-# McIntosh at UCB/CSM.  The :pt: and :uc: have been removed from the original,
-# (the former is untrue, and the latter failed under UCB/man); standout and
-# underline modes have been added.  Note: this entry describes the native
-# capabilities of the PC monochrome display, without ANY emulation; most
-# communications packages (but NOT PC/IX connect) do some kind of emulation.
-pc|ibmpc|ibm pc PC/IX:\
-   :li#24:co#80:am:bs:bw:eo:\
-   :cd=\E[J:ce=\E[K:cl=\Ec:cm=\E[%i%2;%2H:do=\E[B:ho=\E[;H:\
-   :nd=\E[C:up=\E[A:so=\E[7m:se=\E[0m:us=\E[4m:ue=\E[0m:
-pc3|ibmpc3|IBM PC 386BSD Console:\
-   :Co#8:\
-   :DO=\E[%dB:\
-   :F1=\E[W:\
-   :F2=\E[X:\
-   :K1=\E[H:\
-   :K2=\E[I:\
-   :K3=\E[E:\
-   :K4=\E[F:\
-   :K5=\E[G:\
-   :LE=\E[%dD:\
-   :RI=\E[%dC:\
-   :AB=\E[1;%dx:\
-   :AF=\E[2;%dx:\
-   :UP=\E[%dA:\
-   
:ac=l\332m\300k\277j\331u\264t\303v\301w\302q\304x\263n\305`^Da\260f\370g\361~\371.^Y-^Xh\261i^U0\333y\363z\362:\
-   :am:\
-   :bl=^G:\
-   :bs:\
-   :cb=\E[1K:\
-   :cd=\E[J:\
-   :ce=\E[K:\
-   :cl=\E[H\E[J:\
-   :cm=\E[%i%d;%dH:\
-   :co#80:\
-   :cr=^M:\
-   :do=\E[B:\
-   :ho=\E[H:\
-   :is=\E[m:\
-   :it#8:\
-   :k;=\E[V:\
-   :k1=\E[M:\
-   :k2=\E[N:\
-   :k3=\E[O:\
-   :k4=\E[P:\
-   :k5=\E[Q:\
-   :k6=\E[R:\
-   :k7=\E[S:\
-   :k8=\E[T:\
-   :k9=\E[U:\
-   :kD=\177:\
-   :@7=\E[F:\
-   :kN=\E[G:\
-   :kP=\E[I:\
-   :kb=\177:\
-   :kd=\E[B:\
-   :kh=\E[H:\
-   :kl=\E[D:\
-   :kr=\E[C:\
-   :ku=\E[A:\
-   :le=^H:\
-   :li#25:\
-   :ms:\
-   :nd=\E[C:\
-   :op=\E[x:\
-   :pa#64:\
-   :rs=\E[m:\
-   :se=\E[m:\
-   :sf=\E[S:\
-   :so=\E[7;1r\E[7m:\
-   :sr=\E[T:\
-   :ta=^I:\
-   :te=\E[m:\
-   :ti=\E[m:\
-   :up=\E[A:\
-   :ut:
+SC|screen|VT 100/ANSI X3.64 virtual terminal:\
+   :am:xn:ms:mi:G0:km:\
+   :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
+   :cb=\E[1K:cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\
+   :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\
+   :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\
+   :li#24:co#80:us=\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:\
+   :mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:sr=\EM:al=\E[L:\
+   :AL=\E[%dL:dl=\E[M:DL=\E[%dM:cs=\E[%i%d;%dr:dc=\E[P:\
+   :DC=\E[%dP:im=\E[4h:ei=\E[4l:IC=\E[%d@:\
+   :ks=\E[?1h\E=:ke=\E[?1l\E:vb=\Eg:\
+   :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
+   :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
+   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
+   :F3=\E[25~:F4=\E[26~:F5=\E[28~:F6=\E[29~:\
+   :F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\
+   :kh=\E[1~:kI=\E[2~:kD=\E[3~:@7=\E[4~:kP=\E[5~:\
+   :kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\
+   :vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
+   :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
+   :ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:
+
+vt100|dec-vt100|vt100-am|vt100am|dec vt100:\
+   :do=2\E[B:co#80:li#24:cl=50\E[H\E[J:sf=2*\ED:\
+   :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
+   :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
+   :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:\
+   :is=\E\E[?1;3;4;5l\E[?7;8h\E[1;24r\E[24;1H:\
+   :if=/usr/share/tabset/vt100:nw=2\EE:ho=\E[H:\
+   

Re: svn commit: r204759 - in head: etc/defaults etc/rc.d share/man/man5

2010-03-07 Thread Alexander Leidinger
On Sat, 06 Mar 2010 11:41:27 -0800 Doug Barton do...@freebsd.org
wrote:

 On 3/6/2010 7:25 AM, Alexander Leidinger wrote:

  The trick with command_args is neat, but it is a pitfall in case
  someone wants to use it in the future. Wouldn't it be better to add
  the ampersand to it instead of letting the ampersand replace the
  value?
 
 Yes, obviously if someone wants to use command_args for an additional 
 purpose down the road changes will have to be made. It's not in use
 atm however, so IMO simpler is better.

In general I agree to KISS, but the change now would be
  command_args=${command_args}
which is not complex at all and is safer for the future.

Bye,
Alexander.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204825 - head/sys/compat/linprocfs

2010-03-07 Thread Ed Schouten
Author: ed
Date: Sun Mar  7 10:43:45 2010
New Revision: 204825
URL: http://svn.freebsd.org/changeset/base/204825

Log:
  Make /proc/self/fd `work'.
  
  On Linux, /proc/pid/fd is comparable to fdescfs, where it allows you
  to inspect the file descriptors used by each process. Glibc's ttyname()
  works by performing a readlink() on these nodes, since all nodes in this
  directory are symlinks.
  
  It is a bit hard to implement this in linprocfs right now, so I am not
  going to bother. Add a way to make ttyname(3) work, by adding a
  /proc/pid/fd symlink, which points to /dev/fd only if the calling
  process matches. When fdescfs is mounted, this will cause the
  readlink() in ttyname() to fail, causing it to fall back on manually
  finding a matching node in /dev.
  
  Discussed on: emulation@

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Sun Mar  7 10:08:00 2010
(r204824)
+++ head/sys/compat/linprocfs/linprocfs.c   Sun Mar  7 10:43:45 2010
(r204825)
@@ -1245,6 +1245,20 @@ linprocfs_domodules(PFS_FILL_ARGS)
 #endif
 
 /*
+ * Filler function for proc/pid/fd
+ */
+static int
+linprocfs_dofdescfs(PFS_FILL_ARGS)
+{
+
+   if (p == curproc)
+   sbuf_printf(sb, /dev/fd);
+   else
+   sbuf_printf(sb, unknown);
+   return (0);
+}
+
+/*
  * Constructor
  */
 static int
@@ -1312,6 +1326,8 @@ linprocfs_init(PFS_INIT_ARGS)
NULL, NULL, NULL, PFS_RD);
pfs_create_file(dir, status, linprocfs_doprocstatus,
NULL, NULL, NULL, PFS_RD);
+   pfs_create_link(dir, fd, linprocfs_dofdescfs,
+   NULL, NULL, NULL, 0);
 
/* /proc/scsi/... */
dir = pfs_create_dir(root, scsi, NULL, NULL, NULL, 0);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r204803 - head/usr.bin/uniq

2010-03-07 Thread Jaakko Heinonen
On 2010-03-06, Andrey A. Chernov wrote:
   
   3) Enforce the implied LINE_MAX limit (from POSIX definition of text file
   and POSIX uniq(1) description).

Although a file with lines longer than LINE_MAX isn't a text file by
POSIX definition I don't think that POSIX requires uniq(1) to reject
non-POSIX text files. Thus I would like to keep the support for longer
lines.

-- 
Jaakko
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204826 - head/sys/netinet

2010-03-07 Thread Robert Watson
Author: rwatson
Date: Sun Mar  7 10:47:47 2010
New Revision: 204826
URL: http://svn.freebsd.org/changeset/base/204826

Log:
  Make udp_set_kernel_tunneling() less forgiving when its invariants are
  violated: so_pcb can never be NULL for a valid UDP socket, and it is
  always SOCK_DGRAM.  Use sotoinpcb() as the rest of the UDP code does.
  
  MFC after:1 week
  Reviewed by:  bz
  Sponsored by: Juniper Networks

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==
--- head/sys/netinet/udp_usrreq.c   Sun Mar  7 10:43:45 2010
(r204825)
+++ head/sys/netinet/udp_usrreq.c   Sun Mar  7 10:47:47 2010
(r204826)
@@ -1430,7 +1430,7 @@ udp_attach(struct socket *so, int proto,
return (error);
}
 
-   inp = (struct inpcb *)so-so_pcb;
+   inp = sotoinpcb(so);
inp-inp_vflag |= INP_IPV4;
inp-inp_ip_ttl = V_ip_defttl;
 
@@ -1453,17 +1453,10 @@ udp_set_kernel_tunneling(struct socket *
struct inpcb *inp;
struct udpcb *up;
 
-   KASSERT(so-so_type == SOCK_DGRAM, (udp_set_kernel_tunneling: 
!dgram));
-   KASSERT(so-so_pcb != NULL, (udp_set_kernel_tunneling: NULL inp));
-   if (so-so_type != SOCK_DGRAM) {
-   /* Not UDP socket... sorry! */
-   return (ENOTSUP);
-   }
-   inp = (struct inpcb *)so-so_pcb;
-   if (inp == NULL) {
-   /* NULL INP? */
-   return (EINVAL);
-   }
+   KASSERT(so-so_type == SOCK_DGRAM,
+   (udp_set_kernel_tunneling: !dgram));
+   inp = sotoinpcb(so);
+   KASSERT(inp != NULL, (udp_set_kernel_tunneling: inp == NULL));
INP_WLOCK(inp);
up = intoudpcb(inp);
if (up-u_tun_func != NULL) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Additionally (was Re: svn commit: r204803 - head/usr.bin/uniq)

2010-03-07 Thread Andrey Chernov
On Sun, Mar 07, 2010 at 02:52:11PM +0300, Andrey Chernov wrote:
 On Sun, Mar 07, 2010 at 12:46:27PM +0200, Jaakko Heinonen wrote:
  On 2010-03-06, Andrey A. Chernov wrote:
 3) Enforce the implied LINE_MAX limit (from POSIX definition of text 
   file
 and POSIX uniq(1) description).
  
  Although a file with lines longer than LINE_MAX isn't a text file by
  POSIX definition I don't think that POSIX requires uniq(1) to reject
  non-POSIX text files. Thus I would like to keep the support for longer
  lines.
 
 Strictly speaking, POSIX says that uniq(1) (among others) supposed to work 
 with text files. Keeping it working with non-text ones too will be an 
 _extension_, not covered by POSIX.
 
 But thinking about your suggestion the question immediately arises: how 
 much longer lines? say, up to 6x times? up part of memory avaliable? up 
 to size_t max? etc.
 
 Any sort of limit still will remains the limit, but we already have POSIX 
 limit for that. I don't see much sense to replace one limit with the same 
 kind of it, but, say, 2x bigger.
 
 Moreover, very big limits will cause security risk easily producing lack 
 of resources (memory).

If you feel that current LINE_MAX 2048 is too low limit, the proper fix 
will be to bump it, but allowing uncontrollable grown lines leads to 
denial-of-service attacks (not exhausted memory only but infinite swap 
too).

-- 
http://ache.pp.ru/
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204829 - head/sys/netinet

2010-03-07 Thread Robert Watson
Author: rwatson
Date: Sun Mar  7 14:13:59 2010
New Revision: 204829
URL: http://svn.freebsd.org/changeset/base/204829

Log:
  Add comment in tcp_discardcb() talking about how we don't, but should,
  address TCP races relating to not calling tcp_drain() on stopped callouts.
  
  Discussed with:   bz

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Sun Mar  7 12:41:42 2010(r204828)
+++ head/sys/netinet/tcp_subr.c Sun Mar  7 14:13:59 2010(r204829)
@@ -835,8 +835,19 @@ tcp_discardcb(struct tcpcb *tp)
INP_WLOCK_ASSERT(inp);
 
/*
-* Make sure that all of our timers are stopped before we
-* delete the PCB.
+* Make sure that all of our timers are stopped before we delete the
+* PCB.
+*
+* XXXRW: Really, we would like to use callout_drain() here in order
+* to avoid races experienced in tcp_timer.c where a timer is already
+* executing at this point.  However, we can't, both because we're
+* running in a context where we can't sleep, and also because we
+* hold locks required by the timers.  What we instead need to do is
+* test to see if callout_drain() is required, and if so, defer some
+* portion of the remainder of tcp_discardcb() to an asynchronous
+* context that can callout_drain() and then continue.  Some care
+* will be required to ensure that no further processing takes place
+* on the tcpcb, even though it hasn't been freed (a flag?).
 */
callout_stop(tp-t_timers-tt_rexmt);
callout_stop(tp-t_timers-tt_persist);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204833 - head

2010-03-07 Thread Antoine Brodin
Author: antoine
Date: Sun Mar  7 14:55:43 2010
New Revision: 204833
URL: http://svn.freebsd.org/changeset/base/204833

Log:
  Remove old documents when they are not compressed.
  (NO_INFOCOMPRESS, NO_DOCCOMPRESS or NO_MANCOMPRESS)
  
  MFC after:1 month

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sun Mar  7 14:31:57 2010(r204832)
+++ head/Makefile.inc1  Sun Mar  7 14:55:43 2010(r204833)
@@ -1259,7 +1259,7 @@ delete-old-files:
@echo  Removing old files (only deletes safe to delete libs)
 # Ask for every old file if the user really wants to remove it.
 # It's annoying, but better safe than sorry.
-   @for file in ${OLD_FILES}; do \
+   @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*.gz:R}; do \
if [ -f ${DESTDIR}/$${file} -o -L ${DESTDIR}/$${file} ]; 
then \
chflags noschg ${DESTDIR}/$${file} 2/dev/null || 
true; \
rm ${RM_I} ${DESTDIR}/$${file}; \
@@ -1279,7 +1279,7 @@ delete-old-files:
 
 check-old-files:
@echo  Checking for old files
-   @for file in ${OLD_FILES}; do \
+   @for file in ${OLD_FILES} ${OLD_FILES:Musr/share/*.gz:R}; do \
if [ -f ${DESTDIR}/$${file} -o -L ${DESTDIR}/$${file} ]; 
then \
echo ${DESTDIR}/$${file}; \
fi; \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204836 - head/tools/regression/bin/sh/parser

2010-03-07 Thread Jilles Tjoelker
Author: jilles
Date: Sun Mar  7 15:08:42 2010
New Revision: 204836
URL: http://svn.freebsd.org/changeset/base/204836

Log:
  sh: Add various testcases for here documents.
  
  They are mainly about expansions in here documents but because all the
  testcases are in $() command substitution, we also test that $() command
  substitution is recursively parsed (or very close to it).

Added:
  head/tools/regression/bin/sh/parser/heredoc1.0   (contents, props changed)

Added: head/tools/regression/bin/sh/parser/heredoc1.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/heredoc1.0  Sun Mar  7 15:08:42 
2010(r204836)
@@ -0,0 +1,85 @@
+# $FreeBSD$
+
+failures=0
+
+check() {
+   if ! eval [ $* ]; then
+   echo Failed: $*
+   : $((failures += 1))
+   fi
+}
+
+check '$(cat EOF
+hi
+EOF
+) = hi'
+
+check '$(cat EOF
+${$+hi}
+EOF
+) = hi'
+
+unset yy
+check '$(cat EOF
+${yy-hi}
+EOF
+) = hi'
+
+check '$(cat EOF
+${$+hi
+there}
+EOF
+) = hi
+there'
+
+check '$(cat EOF
+$((1+1))
+EOF
+) = 2'
+
+check '$(cat EOF
+$(echo hi)
+EOF
+) = hi'
+
+check '$(cat EOF
+`echo hi`
+EOF
+) = hi'
+
+check '$(cat \EOF
+${$+hi}
+EOF
+) = \${\$+hi}'
+
+check '$(cat \EOF
+$(
+EOF
+) = \$\('
+
+check '$(cat \EOF
+`
+EOF
+) = \`'
+
+check '$(cat EOF
+
+EOF
+) = \'
+
+check '$(cat \EOF
+
+EOF
+) = \'
+
+check '$(cat esac
+'''
+esac
+) = 
+
+check '$(cat \)
+'''
+)
+) = 
+
+exit $((failures != 0))
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r204808 - head/sys/net

2010-03-07 Thread Bruce Cran
On Sat, Mar 06, 2010 at 09:27:26PM +, Bjoern A. Zeeb wrote:
 Author: bz
 Date: Sat Mar  6 21:27:26 2010
 New Revision: 204808
 URL: http://svn.freebsd.org/changeset/base/204808
 
 Log:
   Introduce a function rn_detachhead() that will free the
   radix table root nodes.  This is only needed (and available)
   in the virtualization case to free the resources when tearing
   down a virtual network stack.
   
   Sponsored by:   ISPsystem
   Reviewed by:julian, zec
   MFC after:  5 days
 
 Modified:
   head/sys/net/radix.c
   head/sys/net/radix.h
 
 Modified: head/sys/net/radix.c
 ==
 --- head/sys/net/radix.c  Sat Mar  6 21:24:32 2010(r204807)
 +++ head/sys/net/radix.c  Sat Mar  6 21:27:26 2010(r204808)
 @@ -1161,6 +1161,24 @@ rn_inithead(head, off)
   return (1);
  }
  
 +#ifdef VIMAGE
 +int
 +rn_detachhead(void **head)
 +{
 + struct radix_node_head *rnh;
 +
 + KASSERT((head != NULL  *head != NULL),
 + (%s: head already freed, __func__));
 + rnh = *head;
 + 
 + /* Free left,root,right nodes. */
 + Free(rnh);
 +
 + *head = NULL;
 + return (1);
 +}
 +#endif

Is this sufficient to free all the memory? From what I can see, 'Free' is 
just freeing the pointer and not walking the tree to free the nodes too.

I don't know if the memory allocation is being done differently, but I 
fixed the same issue on Windows by introducing a 'rn_free_subtree' 
function - I don't know if it's entirely correct but the code can be 
seen at 
http://www.bluestop.org/viewvc/repos/sctpDrv/net/radix.c?r1=24r2=23pathrev=24

I also found that rn_zeros wasn't being freed when the driver got 
unloaded.

-- 
Bruce Cran
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r204803 - head/usr.bin/uniq

2010-03-07 Thread Bruce Evans

On Sun, 7 Mar 2010, Jaakko Heinonen wrote:


On 2010-03-06, Andrey A. Chernov wrote:


  3) Enforce the implied LINE_MAX limit (from POSIX definition of text file
  and POSIX uniq(1) description).


This seems to enforce a limit of LINE_MAX - 1, since space for the NUL
terminator is no longer provided.  Hopfully there is no buffer overrun
from this.


Although a file with lines longer than LINE_MAX isn't a text file by
POSIX definition I don't think that POSIX requires uniq(1) to reject
non-POSIX text files. Thus I would like to keep the support for longer
lines.


There was a long discussion about this in the Opengroup list recently.
An example in POSIX has an off-by-2 error instead of the above off-by-1
error, since its buffer size is only LINE_MAX and it loses an extra 1
by putting the terminating newline in the buffer.  The example is also
bad in using LINE_MAX, since {LINE_MAX} is not necessarily constant.
Dynamic allocation is required to use sysconf(__SC_LINE_MAX) and once
you do that it is almost as easy to support arbitrary line lengths
like FreeBSD used to.

Old versions of FreeBSD didn't have any of the dynamic allocation, or
the off-by-1 error, or the new (as I remember) error handling of
aborting for long lines; they silently discarded characters after the
LINE_MAX'th one.

Bruce.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204837 - in head/sys: net netinet/ipfw

2010-03-07 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Mar  7 15:37:58 2010
New Revision: 204837
URL: http://svn.freebsd.org/changeset/base/204837

Log:
  Not only flush the ipfw tables when unloading ipfw or tearing
  down a virtual netowrk stack, but also free the Radix Node Head.
  
  Sponsored by: ISPsystem
  Reviewed by:  julian
  MFC after:5 days

Modified:
  head/sys/net/radix.c
  head/sys/net/radix.h
  head/sys/netinet/ipfw/ip_fw2.c
  head/sys/netinet/ipfw/ip_fw_private.h
  head/sys/netinet/ipfw/ip_fw_table.c

Modified: head/sys/net/radix.c
==
--- head/sys/net/radix.cSun Mar  7 15:08:42 2010(r204836)
+++ head/sys/net/radix.cSun Mar  7 15:37:58 2010(r204837)
@@ -1161,7 +1161,6 @@ rn_inithead(head, off)
return (1);
 }
 
-#ifdef VIMAGE
 int
 rn_detachhead(void **head)
 {
@@ -1177,7 +1176,6 @@ rn_detachhead(void **head)
*head = NULL;
return (1);
 }
-#endif
 
 void
 rn_init(int maxk)

Modified: head/sys/net/radix.h
==
--- head/sys/net/radix.hSun Mar  7 15:08:42 2010(r204836)
+++ head/sys/net/radix.hSun Mar  7 15:37:58 2010(r204837)
@@ -162,9 +162,7 @@ struct radix_node_head {
 
 voidrn_init(int);
 int rn_inithead(void **, int);
-#ifdef VIMAGE
 int rn_detachhead(void **);
-#endif
 int rn_refines(void *, void *);
 struct radix_node
 *rn_addmask(void *, int, int),

Modified: head/sys/netinet/ipfw/ip_fw2.c
==
--- head/sys/netinet/ipfw/ip_fw2.c  Sun Mar  7 15:08:42 2010
(r204836)
+++ head/sys/netinet/ipfw/ip_fw2.c  Sun Mar  7 15:37:58 2010
(r204837)
@@ -2392,7 +2392,7 @@ vnet_ipfw_uninit(const void *unused)
IPFW_WLOCK(chain);
 
ipfw_dyn_uninit(0); /* run the callout_drain */
-   ipfw_flush_tables(chain);
+   ipfw_destroy_tables(chain);
reap = NULL;
for (i = 0; i  chain-n_rules; i++) {
rule = chain-map[i];

Modified: head/sys/netinet/ipfw/ip_fw_private.h
==
--- head/sys/netinet/ipfw/ip_fw_private.h   Sun Mar  7 15:08:42 2010
(r204836)
+++ head/sys/netinet/ipfw/ip_fw_private.h   Sun Mar  7 15:37:58 2010
(r204837)
@@ -272,6 +272,7 @@ struct radix_node;
 int ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
 uint32_t *val);
 int ipfw_init_tables(struct ip_fw_chain *ch);
+void ipfw_destroy_tables(struct ip_fw_chain *ch);
 int ipfw_flush_table(struct ip_fw_chain *ch, uint16_t tbl);
 void ipfw_flush_tables(struct ip_fw_chain *ch);
 int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,

Modified: head/sys/netinet/ipfw/ip_fw_table.c
==
--- head/sys/netinet/ipfw/ip_fw_table.c Sun Mar  7 15:08:42 2010
(r204836)
+++ head/sys/netinet/ipfw/ip_fw_table.c Sun Mar  7 15:37:58 2010
(r204837)
@@ -203,6 +203,21 @@ ipfw_init_tables(struct ip_fw_chain *ch)
return (0);
 }
 
+void
+ipfw_destroy_tables(struct ip_fw_chain *ch)
+{
+   int tbl;
+   struct radix_node_head *rnh;
+
+   IPFW_WLOCK_ASSERT(ch);
+
+   ipfw_flush_tables(ch);
+   for (tbl = 0; tbl  IPFW_TABLES_MAX; tbl++) {
+   rnh = ch-tables[tbl];
+   rn_detachhead((void **)rnh);
+   }
+}
+
 int
 ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
 uint32_t *val)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r204803 - head/usr.bin/uniq

2010-03-07 Thread Andrey Chernov
On Mon, Mar 08, 2010 at 02:17:41AM +1100, Bruce Evans wrote:
3) Enforce the implied LINE_MAX limit (from POSIX definition of text 
  file
and POSIX uniq(1) description).
 
 This seems to enforce a limit of LINE_MAX - 1, since space for the NUL
 terminator is no longer provided.  Hopfully there is no buffer overrun
 from this.

{LINE_MAX} _includes_ trailing \n separator according to POSIX, so real 
characters count is {LINE_MAX} - 1. 

Since we strip \n on read in uniq(1), there is a room for placing \0 
appears, so no off-by-1 error.

 by putting the terminating newline in the buffer.  The example is also
 bad in using LINE_MAX, since {LINE_MAX} is not necessarily constant.
 Dynamic allocation is required to use sysconf(__SC_LINE_MAX) and once
 you do that it is almost as easy to support arbitrary line lengths
 like FreeBSD used to.

It is right idea. I'll use sysconf(__SC_LINE_MAX) there.
But currently it does the same (sysconf.c):
case _SC_LINE_MAX:
return (LINE_MAX);

 Old versions of FreeBSD didn't have any of the dynamic allocation, or
 the off-by-1 error, or the new (as I remember) error handling of
 aborting for long lines; they silently discarded characters after the
 LINE_MAX'th one.

To add more:
NetBSD uniq grows (contrary, NetBSD comm silently discarding everything 
afterwards).
OpenBSD uniq just use fgets with 8192.
GNU uniq grows.

Unrestricted growing can provide problems I already mention in previous 
replies.
Silent discarding allows some trick with input and silent wrong handling 
of them.
What is more dangerous - very depends on situation.

-- 
http://ache.pp.ru/
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204842 - head/tools/regression/bin/sh/expansion

2010-03-07 Thread Jilles Tjoelker
Author: jilles
Date: Sun Mar  7 18:43:29 2010
New Revision: 204842
URL: http://svn.freebsd.org/changeset/base/204842

Log:
  sh: Add some testcases for ${v=w}, ${v-w}, ${v+w}.
  
  These expansions, which were already in the Bourne shell, work correctly for
  the most part. The testcases are only about the parts that already work
  correctly.

Added:
  head/tools/regression/bin/sh/expansion/assign1.0   (contents, props changed)
  head/tools/regression/bin/sh/expansion/plus-minus1.0   (contents, props 
changed)

Added: head/tools/regression/bin/sh/expansion/assign1.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/assign1.0Sun Mar  7 18:43:29 
2010(r204842)
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
+h='##'
+failures=''
+ok=''
+
+testcase() {
+   code=$1
+   expected=$2
+   oIFS=$IFS
+   eval $code
+   IFS='|'
+   result=$#|$*
+   IFS=$oIFS
+   if [ x$result = x$expected ]; then
+   ok=x$ok
+   else
+   failures=x$failures
+   echo For $code, expected $expected actual $result
+   fi
+}
+
+testcase 'v=; set -- ${v=a b} $v'  '0|'
+testcase 'unset v; set -- ${v=a b} $v' '4|a|b|a|b'
+testcase 'v=; set -- ${v:=a b} $v' '4|a|b|a|b'
+testcase 'v=; set -- ${v:=a b} $v' '2|a b|a b'
+# expect sensible behaviour, although it disagrees with POSIX
+testcase 'v=; set -- ${v:=a\ b} $v''4|a|b|a|b'
+testcase 'v=; set -- ${v:=$p} $v'  '2|/etc/|/etc/'
+testcase 'v=; set -- ${v:=$p} $v'  '2|/et[c]/|/et[c]/'
+testcase 'v=; set -- ${v:=a\ b} $v''2|a\ b|a\ b'
+testcase 'v=; set -- ${v:=$p} $v''2|/etc/|/etc/'
+# whether $p is quoted or not shouldn't really matter
+testcase 'v=; set -- ${v:=$p} $v''2|/et[c]/|/et[c]/'
+
+test x$failures = x

Added: head/tools/regression/bin/sh/expansion/plus-minus1.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/plus-minus1.0Sun Mar  7 
18:43:29 2010(r204842)
@@ -0,0 +1,81 @@
+# $FreeBSD$
+
+e= q='?' a='*' t=texttext s='ast*que?non' p='/et[c]/' w='a b c' b='{{(#)}}'
+h='##'
+failures=''
+ok=''
+
+testcase() {
+   code=$1
+   expected=$2
+   oIFS=$IFS
+   eval $code
+   IFS='|'
+   result=$#|$*
+   IFS=$oIFS
+   if [ x$result = x$expected ]; then
+   ok=x$ok
+   else
+   failures=x$failures
+   echo For $code, expected $expected actual $result
+   fi
+}
+
+testcase 'set -- a b'  '2|a|b'
+testcase 'set --'  '0|'
+testcase 'set -- ${e}' '0|'
+testcase 'set -- ${e}'   '1|'
+
+testcase 'set -- $p'   '1|/etc/'
+testcase 'set -- $p' '1|/et[c]/'
+testcase 'set -- ${s+$p}'  '1|/etc/'
+testcase 'set -- ${s+$p}''1|/et[c]/'
+testcase 'set -- ${s+$p}''1|/et[c]/'
+# Dquotes in dquotes is undefined for Bourne shell operators
+#testcase 'set -- ${s+$p}' '1|/et[c]/'
+testcase 'set -- ${e:-$p}' '1|/etc/'
+testcase 'set -- ${e:-$p}'   '1|/et[c]/'
+testcase 'set -- ${e:-$p}'   '1|/et[c]/'
+# Dquotes in dquotes is undefined for Bourne shell operators
+#testcase 'set -- ${e:-$p}''1|/et[c]/'
+testcase 'set -- ${e:+$e}'   '0|'
+testcase 'set -- ${e:+$w$e}' '0|'
+testcase 'set -- ${w:+$w}'   '1|a b c'
+testcase 'set -- ${w:+$w$w}' '3|a|b|ca b c'
+
+# These two are known broken in FreeBSD /bin/sh
+#testcase 'set -- ${s+a b}''2|a|b'
+#testcase 'set -- ${e:-a b}'   '2|a|b'
+testcase 'set -- ${s+a b}'   '1|a b'
+testcase 'set -- ${e:-a b}'  '1|a b'
+testcase 'set -- ${e:-\}}' '1|}'
+# Currently broken in FreeBSD /bin/sh
+#testcase 'set -- ${e:-\}}'  '1|}'
+testcase 'set -- ${e:+{}}' '1|}'
+testcase 'set -- ${e:+{}}'   '1|}'
+
+testcase 'set -- ${e+x}${e+x}' '1|xx'
+testcase 'set -- ${e+x}${e+x}'   '1|xx'
+testcase 'set -- ${e+x}${e+x}'   '1|xx'
+testcase 'set -- ${e+x}${e+x}'   '1|xx'
+testcase 'set -- ${e+x}${e+x}' '1|xx'
+
+testcase 'set -- ${e:-${e:-$p}}'   '1|/etc/'
+testcase 'set -- ${e:-${e:-$p}}' '1|/et[c]/'
+testcase 'set -- ${e:-${e:-$p}}' '1|/et[c]/'
+testcase 'set -- ${e:-${e:-$p}}' 

Re: svn commit: r204803 - head/usr.bin/uniq

2010-03-07 Thread Andrey Chernov
On Sun, Mar 07, 2010 at 09:31:39PM +0300, Andrey Chernov wrote:
 It is right idea. I'll use sysconf(__SC_LINE_MAX) there.
 But currently it does the same (sysconf.c):
 case _SC_LINE_MAX:
 return (LINE_MAX);
...
 To add more:
 NetBSD uniq grows (contrary, NetBSD comm silently discarding everything 
 afterwards).
 OpenBSD uniq just use fgets with 8192.
 GNU uniq grows.

After thinking a bit more I consider to reimplement unlimited lines here 
instead because enforcing POSIX limit was not the main goal of my commit 
(it was to remove getwc() which is evil). Someone may deal with the limit 
on his own way afterwards.

Will be in the next commit.

-- 
http://ache.pp.ru/
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r204824 - head/sys/conf

2010-03-07 Thread M. Warner Losh
In message: 201003071008.o27a80wc014...@svn.freebsd.org
David E. O'Brien obr...@freebsd.org writes:
: Author: obrien
: Date: Sun Mar  7 10:08:00 2010
: New Revision: 204824
: URL: http://svn.freebsd.org/changeset/base/204824
: 
: Log:
:   Look for compile to decide if this is run as part of the kernel build.
:   The assumption of ${ARCH}/compile/FOO is much harder to change in our
:   build (so assume one hasn't), then assuming every kernel is rooted at 
sys/.

Except buildkernel builds the kernel into
$MAKEOBJDIRPREFIX/$ARCH/$PATH_TO_TOP/sys/FOO ($ARCH/ is omitted when
building natively).

Please back out this change.  It is unwise, I think.

Warner

: Modified:
:   head/sys/conf/newvers.sh
: 
: Modified: head/sys/conf/newvers.sh
: ==
: --- head/sys/conf/newvers.sh  Sun Mar  7 09:52:35 2010(r204823)
: +++ head/sys/conf/newvers.sh  Sun Mar  7 10:08:00 2010(r204824)
: @@ -88,15 +88,15 @@ v=`cat version` u=${USER:-root} d=`pwd` 
:  i=`${MAKE:-make} -V KERN_IDENT`
:  
:  case $d in
: -*/sys/*)
: +*/compile/*)
:   SRCDIR=${d##*obj}
:   if [ -n $MACHINE ]; then
:   SRCDIR=${SRCDIR##/$MACHINE}
:   fi
: - SRCDIR=${SRCDIR%%/sys/*}
: + SRCDIR=$(cd ${SRCDIR%%/compile/*}/..  pwd)
:  
:   for dir in /bin /usr/bin /usr/local/bin; do
: - if [ -d ${SRCDIR}/sys/.svn -a -x ${dir}/svnversion ] ; then
: + if [ -d ${SRCDIR}/.svn -a -x ${dir}/svnversion ] ; then
:   svnversion=${dir}/svnversion
:   break
:   fi
: @@ -107,7 +107,7 @@ case $d in
:   done
:  
:   if [ -n $svnversion ] ; then
: - svn= r`cd ${SRCDIR}/sys  $svnversion`
: + svn= r`cd ${SRCDIR}  $svnversion`
:   fi
:   if [ -n $git_cmd ] ; then
:   git=`$git_cmd rev-parse --verify --short HEAD 2/dev/null`
: 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r204849 - head/usr.bin/ncal

2010-03-07 Thread Edwin Groothuis
Author: edwin
Date: Sun Mar  7 21:54:28 2010
New Revision: 204849
URL: http://svn.freebsd.org/changeset/base/204849

Log:
  - document the -3, -A and -B properly in Synopsis.
  - add highlight of current date for non-terminals.
  - fix -J option.
  - code cleanup.
  
  MFC after:2 weeks

Modified:
  head/usr.bin/ncal/ncal.1
  head/usr.bin/ncal/ncal.c

Modified: head/usr.bin/ncal/ncal.1
==
--- head/usr.bin/ncal/ncal.1Sun Mar  7 21:50:40 2010(r204848)
+++ head/usr.bin/ncal/ncal.1Sun Mar  7 21:54:28 2010(r204849)
@@ -33,24 +33,32 @@
 .Nd displays a calendar and the date of Easter
 .Sh SYNOPSIS
 .Nm
-.Op Fl hjy
+.Op Fl 3hjy
+.Op Fl A Ar number
+.Op Fl B Ar number
 .Oo
 .Op Ar month
 .Ar year
 .Oc
 .Nm
-.Op Fl hj
+.Op Fl 3hj
+.Op Fl A Ar number
+.Op Fl B Ar number
 .Fl m Ar month
 .Op Ar year
 .Nm ncal
-.Op Fl hjJpwy
+.Op Fl 3hjJpwy
+.Op Fl A Ar number
+.Op Fl B Ar number
 .Op Fl s Ar country_code
 .Oo
 .Op Ar month
 .Ar year
 .Oc
 .Nm ncal
-.Op Fl hJeo
+.Op Fl 3hJeo
+.Op Fl A Ar number
+.Op Fl B Ar number
 .Op Ar year
 .Sh DESCRIPTION
 The

Modified: head/usr.bin/ncal/ncal.c
==
--- head/usr.bin/ncal/ncal.cSun Mar  7 21:50:40 2010(r204848)
+++ head/usr.bin/ncal/ncal.cSun Mar  7 21:54:28 2010(r204849)
@@ -159,10 +159,10 @@ char jdaystr[] =1   2   3   4  
  350 351 352 353 354 355 356 357 358 359
  360 361 362 363 364 365 366;
 
+intflag_nohighlight;   /* user doesn't want a highlighted today */
 int flag_weeks;/* user wants number of week */
 int nswitch;   /* user defined switch date */
 intnswitchb;   /* switch date for backward compatibility */
-const char *term_so, *term_se;
 inttoday;
 
 char   *center(char *s, char *t, int w);
@@ -181,6 +181,7 @@ int sndaysb(struct date * d);
 static voidusage(void);
 void   monthranger(int year, int jd_flag, int m, int before, int after);
 void   monthrangeb(int year, int jd_flag, int m, int before, int after);
+void   highlight(char *dst, char *src, int len, int *extraletters);
 
 int
 main(int argc, char *argv[])
@@ -204,15 +205,9 @@ main(int argc, char *argv[])
char*flag_highlightdate = NULL;
int before, after;
const char*locale;  /* locale to get country code */
-   char tbuf[1024], cbuf[512], *b;
 
-   /* On how to highlight on this terminal */
-   term_se = term_so = NULL;
-   if (isatty(STDOUT_FILENO)  tgetent(tbuf, NULL) == 1) {
-   b = cbuf;
-   term_so = tgetstr(so, b);
-   term_se = tgetstr(se, b);
-   }
+   flag_nohighlight = 0;
+   flag_weeks = 0;
 
/*
 * Use locale to determine the country code,
@@ -283,7 +278,7 @@ main(int argc, char *argv[])
flag_highlightdate = optarg;
break;
case 'h':
-   term_so = term_se = NULL;
+   flag_nohighlight = 1;
break;
case 'e':
if (flag_backward)
@@ -369,6 +364,12 @@ main(int argc, char *argv[])
usage();
}
 
+   if (flag_hole_year) {
+   m = 1;
+   before = 0;
+   after = 11;
+   }
+
if (flag_month != NULL) {
if (parsemonth(flag_month, m, y)) {
errx(EX_USAGE,
@@ -717,33 +718,17 @@ mkmonthr(int y, int m, int jd_flag, stru
for (i = 0; i != 7; i++) {
l = 0;
for (j = firstm + i, k = 0; j  last; j += 7, k += dw) {
-   if (j == today 
-   (term_so != NULL  term_se != NULL)) {
-   l = strlen(term_so);
-   if (jd_flag)
-   dt.d = j - jan1 + 1;
-   else
-   sdateb(j, dt);
-   /* separator */
-   mlines-lines[i][k] = ' ';
-   /* the actual text */
-   memcpy(mlines-lines[i] + k + l,
-   ds + dt.d * dw, dw);
-   /* highlight on */
-   memcpy(mlines-lines[i] + k + 1, term_so, l);
-   /* highlight off */
-   memcpy(mlines-lines[i] + k + l + dw, term_se,
-   strlen(term_se));
-   l = strlen(term_se) + strlen(term_so);
-   continue;
-   }
if (j = first) {
if (jd_flag)
   

svn commit: r204850 - head/sys/kern

2010-03-07 Thread Warner Losh
Author: imp
Date: Sun Mar  7 22:37:35 2010
New Revision: 204850
URL: http://svn.freebsd.org/changeset/base/204850

Log:
  Bump up the firmware_table from 30 to 50.  bwn needs more than 30, it
  seems.

Modified:
  head/sys/kern/subr_firmware.c

Modified: head/sys/kern/subr_firmware.c
==
--- head/sys/kern/subr_firmware.c   Sun Mar  7 21:54:28 2010
(r204849)
+++ head/sys/kern/subr_firmware.c   Sun Mar  7 22:37:35 2010
(r204850)
@@ -121,7 +121,7 @@ struct priv_fw {
  * reallocate the array because pointers are held externally.
  * A list may work, though.
  */
-#defineFIRMWARE_MAX30
+#defineFIRMWARE_MAX50
 static struct priv_fw firmware_table[FIRMWARE_MAX];
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r204849 - head/usr.bin/ncal

2010-03-07 Thread Alexander Best
could you have another look at the -J option? it seems highlighting still
isn't enabled in combination with it. also i'm wondering what the purpose of
the -b switch is. running `cal` and `ncal -b` seems to be doing the very same
thing (setting flag_backward = 1).

you might want to consider the following patch.

cheers.
alex
Index: ncal.1
===
--- ncal.1  (revision 204850)
+++ ncal.1  (working copy)
@@ -117,8 +117,6 @@
 Print the number of the week below each week column.
 .It Fl y
 Display a calendar for the specified year.
-.It Fl b
-Switch to backwards compatibility mode (for debugging).
 .It Fl d Ar -mm-dd
 Use
 .Ar -mm-dd
Index: ncal.c
===
--- ncal.c  (revision 204850)
+++ ncal.c  (working copy)
@@ -271,9 +271,6 @@
nswitch = ndaysj(never);
flag_julian_cal = 1;
break;
-   case 'b':
-   flag_backward = 1;
-   break;
case 'd':
flag_highlightdate = optarg;
break;
@@ -412,8 +409,7 @@
usage: cal [-hjy] [[month] year]\n
   cal [-hj] [-m month] [year]\n
   ncal [-hJjpwy] [-s country_code] [[month] year]\n
-  ncal [-hJeo] [year]\n
-   for debug the highlighting: [-b] [-d -mm-dd]\n,
+  ncal [-hJeo] [year]\n,
stderr);
exit(EX_USAGE);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r204849 - head/usr.bin/ncal

2010-03-07 Thread Edwin Groothuis
On Mon, Mar 08, 2010 at 12:16:04AM +0100, Alexander Best wrote:
 could you have another look at the -J option? it seems highlighting still

Aha, only -J in month only view is still not working. Will take
care of it later. Also add a bunch of regression tests to it, because
of all of this.

 isn't enabled in combination with it. also i'm wondering what the purpose of
 the -b switch is. running `cal` and `ncal -b` seems to be doing the very same
 thing (setting flag_backward = 1).

You can't run cal until you have installed it, while being able
to run ncal -b and coming into cal mode is kind of nice.

Edwin

-- 
Edwin Groothuis Website: http://www.mavetju.org/
ed...@mavetju.org   Weblog:  http://www.mavetju.org/weblog/
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r204849 - head/usr.bin/ncal

2010-03-07 Thread Alexander Best
Edwin Groothuis schrieb am 2010-03-08:
 On Mon, Mar 08, 2010 at 12:16:04AM +0100, Alexander Best wrote:
  could you have another look at the -J option? it seems highlighting
  still

 Aha, only -J in month only view is still not working. Will take
 care of it later. Also add a bunch of regression tests to it, because
 of all of this.

  isn't enabled in combination with it. also i'm wondering what the
  purpose of
  the -b switch is. running `cal` and `ncal -b` seems to be doing the
  very same
  thing (setting flag_backward = 1).

 You can't run cal until you have installed it, while being able
 to run ncal -b and coming into cal mode is kind of nice.

thanks for the hint. the -b switch definitely comes in handy when `cal` isn't
available, because one is running ncal from /usr/src/usr.bin.

will the -b switch disappear once you ncal/cal works properly with
highlighting?

what confused me a little is the output of something like `ncal 10 2011`.
judging from ncal(1) i guessed the output to be October of 2011, yet the
output is all months from October 2011 to September 2012.

i tried `ncal -m 10 2011` instead and the output was just the same. so what's
the right way to see the entry for lets say October 2011?

another issue i'm having is the -m switch in combination with f and p. judging
from ncal(1) `ncal -m 3p` should output February 2010 and `ncal -m 3f` April
2010. however instead of printing the previous and next month the previous and
next year gets printed.

running `ncal -m 10f` on the other hand behaves even weirder because it prints
the same as `ncal -m 10`.

alex

 Edwin

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org