Re: svn commit: r217592 - head/sys/netinet

2011-03-30 Thread Daniel Eischen

On Tue, 29 Mar 2011, John Baldwin wrote:


On Wednesday, January 19, 2011 2:07:16 pm Randall Stewart wrote:

Author: rrs
Date: Wed Jan 19 19:07:16 2011
New Revision: 217592
URL: http://svn.freebsd.org/changeset/base/217592

Log:
  Fix a bug where Multicast packets sent from a
  udp endpoint may end up echoing back to the sender
  even with OUT joining the multi-cast group.

  Reviewed by:  gnn, bms, bz?
  Obtained from:deischen (with help from)

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c


==

--- head/sys/netinet/udp_usrreq.c   Wed Jan 19 18:20:11 2011
(r217591)
+++ head/sys/netinet/udp_usrreq.c   Wed Jan 19 19:07:16 2011
(r217592)
@@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off)
 * and source-specific multicast. [RFC3678]
 */
imo = inp->inp_moptions;
-   if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) &&
-   imo != NULL) {
+   if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
struct sockaddr_in   group;
int  blocked;
-
+   if(imo == NULL) {
+   INP_RUNLOCK(inp);
+   continue;
+   }
bzero(&group, sizeof(struct sockaddr_in));
group.sin_len = sizeof(struct sockaddr_in);
group.sin_family = AF_INET;


So it turns out that this is a feature, not a bug, and is how multicast has
always worked.  Specifically, if you bind a UDP socket with a wildcard
address, it should receive all traffic for the bound port, unicast or
multicast.  When you join a group, you have switched the socket into a mode
where it now has a whitelist of acceptable multicast groups, but if a socket
has no joined groups, it should receive all multicast traffic, not none.  This
change breaks that.

I did not find this behavior intuitive at first, but it does seem to be
required.  Note the description of IP_ADD_MEMBERSHIP from RFC 3678 for
example:

3.  Overview of APIs

  There are a number of different APIs described in this document that
  are appropriate for a number of different application types and IP
  versions.  Before providing detailed descriptions, this section
  provides a "taxonomy" with a brief description of each.

  There are two categories of source-filter APIs, both of which are
  designed to allow multicast receiver applications to designate the
  unicast address(es) of sender(s) along with the multicast group
  (destination address) to receive.

 o  Basic (Delta-based): Some applications desire the simplicity of
a delta-based API in which each function call specifies a
single source address which should be added to or removed from
the existing filter for a given multicast group address on
which to listen.  Such applications typically fall into either
of two categories:

+  Any-Source Multicast: By default, all sources are accepted.
   Individual sources may be turned off and back on as needed
   over time.  This is also known as "exclude" mode, since the
   source filter contains a list of excluded sources.

+  Source-Specific Multicast: Only sources in a given list are
   allowed.  The list may change over time.  This is also known
   as "include" mode, since the source filter contains a list
   of included sources.

   This API would be used, for example, by "single-source"
   applications such as audio/video broadcasting.  It would
   also be used for logical multi-source sessions where each
   source independently allocates its own Source-Specific
   Multicast group address.


.

4.1.1.  IPv4 Any-Source Multicast API

  The following socket options are defined in  for
  applications in the Any-Source Multicast category:

  Socket option Argument type
  IP_ADD_MEMBERSHIP struct ip_mreq
  IP_BLOCK_SOURCE   struct ip_mreq_source
  IP_UNBLOCK_SOURCE struct ip_mreq_source
  IP_DROP_MEMBERSHIPstruct ip_mreq

  IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP are already implemented on
  most operating systems, and are used to join and leave an any-source
  group.

  IP_BLOCK_SOURCE can be used to block data from a given source to a
  given group (e.g., if the user "mutes" that source), and
  IP_UNBLOCK_SOURCE can be used to undo this (e.g., if the user then
  "unmutes" the source).

As to why the packets loop back to the receiver, I believe that is a separate
issue on the output side, not the receive side.


That may be, but the behavior is undesired if the n

svn commit: r220154 - in head/etc: etc.amd64 etc.arm etc.i386 etc.ia64 etc.mips etc.pc98 etc.powerpc etc.sparc64

2011-03-30 Thread Ed Schouten
Author: ed
Date: Wed Mar 30 08:22:29 2011
New Revision: 220154
URL: http://svn.freebsd.org/changeset/base/220154

Log:
  Remove the reference to pseudo-terminals from the description.
  
  Pseudo-terminals are no longer listed in this file, since the utmpx
  implementation doesn't depend on ttyslot().

Modified:
  head/etc/etc.amd64/ttys
  head/etc/etc.arm/ttys
  head/etc/etc.i386/ttys
  head/etc/etc.ia64/ttys
  head/etc/etc.mips/ttys
  head/etc/etc.pc98/ttys
  head/etc/etc.powerpc/ttys
  head/etc/etc.sparc64/ttys

Modified: head/etc/etc.amd64/ttys
==
--- head/etc/etc.amd64/ttys Wed Mar 30 01:19:00 2011(r220153)
+++ head/etc/etc.amd64/ttys Wed Mar 30 08:22:29 2011(r220154)
@@ -16,9 +16,8 @@
 # type The initial terminal type for this port.  For hardwired
 #  terminal lines, this will contain the type of terminal used.
 #  For virtual consoles, the correct type is typically xterm.
-#  Other common values include network for network connections on
-#  pseudo-terminals, dialup for incoming modem ports, and unknown
-#  when the terminal type cannot be predetermined.
+#  Other common values include dialup for incoming modem ports, and
+#  unknown when the terminal type cannot be predetermined.
 #
 # status Must be on or off.  If on, init will run the getty program on
 #the specified port.  If the word "secure" appears, this tty

Modified: head/etc/etc.arm/ttys
==
--- head/etc/etc.arm/ttys   Wed Mar 30 01:19:00 2011(r220153)
+++ head/etc/etc.arm/ttys   Wed Mar 30 08:22:29 2011(r220154)
@@ -16,9 +16,8 @@
 # type The initial terminal type for this port.  For hardwired
 #  terminal lines, this will contain the type of terminal used.
 #  For virtual consoles, the correct type is typically xterm.
-#  Other common values include network for network connections on
-#  pseudo-terminals, dialup for incoming modem ports, and unknown
-#  when the terminal type cannot be predetermined.
+#  Other common values include dialup for incoming modem ports, and
+#  unknown when the terminal type cannot be predetermined.
 #
 # status Must be on or off.  If on, init will run the getty program on
 #the specified port.  If the word "secure" appears, this tty

Modified: head/etc/etc.i386/ttys
==
--- head/etc/etc.i386/ttys  Wed Mar 30 01:19:00 2011(r220153)
+++ head/etc/etc.i386/ttys  Wed Mar 30 08:22:29 2011(r220154)
@@ -16,9 +16,8 @@
 # type The initial terminal type for this port.  For hardwired
 #  terminal lines, this will contain the type of terminal used.
 #  For virtual consoles, the correct type is typically xterm.
-#  Other common values include network for network connections on
-#  pseudo-terminals, dialup for incoming modem ports, and unknown
-#  when the terminal type cannot be predetermined.
+#  Other common values include dialup for incoming modem ports, and
+#  unknown when the terminal type cannot be predetermined.
 #
 # status Must be on or off.  If on, init will run the getty program on
 #the specified port.  If the word "secure" appears, this tty

Modified: head/etc/etc.ia64/ttys
==
--- head/etc/etc.ia64/ttys  Wed Mar 30 01:19:00 2011(r220153)
+++ head/etc/etc.ia64/ttys  Wed Mar 30 08:22:29 2011(r220154)
@@ -16,9 +16,8 @@
 # type The initial terminal type for this port.  For hardwired
 #  terminal lines, this will contain the type of terminal used.
 #  For virtual consoles, the correct type is typically xterm.
-#  Other common values include network for network connections on
-#  pseudo-terminals, dialup for incoming modem ports, and unknown
-#  when the terminal type cannot be predetermined.
+#  Other common values include dialup for incoming modem ports, and
+#  unknown when the terminal type cannot be predetermined.
 #
 # status Must be on or off.  If on, init will run the getty program on
 #the specified port.  If the word "secure" appears, this tty

Modified: head/etc/etc.mips/ttys
==
--- head/etc/etc.mips/ttys  Wed Mar 30 01:19:00 2011(r220153)
+++ head/etc/etc.mips/ttys  Wed Mar 30 08:22:29 2011(r220154)
@@ -16,9 +16,8 @@
 # type The initial terminal type for this port.  For hardwired
 #  terminal lines, this will contain the type of terminal used.
 #  For virtual consoles, the correct type is typically xterm.
-#  Other common values include network for network connections on
-#  pseudo-terminals, dialup for incoming modem ports, and unknown
-#  when the termi

Re: svn commit: r217592 - head/sys/netinet

2011-03-30 Thread Randall Stewart
John:

The original complaint on this came from Daniel... I believe he
claimed that up until bms's multi-cast work.. you would NOT
get a packet sent to you if you did not join the multi-cast group.

I will also comment in-line below...

On Mar 29, 2011, at 2:01 PM, John Baldwin wrote:

> On Wednesday, January 19, 2011 2:07:16 pm Randall Stewart wrote:
>> Author: rrs
>> Date: Wed Jan 19 19:07:16 2011
>> New Revision: 217592
>> URL: http://svn.freebsd.org/changeset/base/217592
>> 
>> Log:
>>  Fix a bug where Multicast packets sent from a
>>  udp endpoint may end up echoing back to the sender
>>  even with OUT joining the multi-cast group.
>> 
>>  Reviewed by:gnn, bms, bz?
>>  Obtained from:  deischen (with help from)
>> 
>> Modified:
>>  head/sys/netinet/udp_usrreq.c
>> 
>> Modified: head/sys/netinet/udp_usrreq.c
>> 
> ==
>> --- head/sys/netinet/udp_usrreq.cWed Jan 19 18:20:11 2011
>> (r217591)
>> +++ head/sys/netinet/udp_usrreq.cWed Jan 19 19:07:16 2011
>> (r217592)
>> @@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off)
>>   * and source-specific multicast. [RFC3678]
>>   */
>>  imo = inp->inp_moptions;
>> -if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) &&
>> -imo != NULL) {
>> +if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
>>  struct sockaddr_in   group;
>>  int  blocked;
>> -
>> +if(imo == NULL) {
>> +INP_RUNLOCK(inp);
>> +continue;
>> +}
>>  bzero(&group, sizeof(struct sockaddr_in));
>>  group.sin_len = sizeof(struct sockaddr_in);
>>  group.sin_family = AF_INET;
> 
> So it turns out that this is a feature, not a bug, and is how multicast has 
> always worked.  Specifically, if you bind a UDP socket with a wildcard 
> address, it should receive all traffic for the bound port, unicast or 
> multicast.  When you join a group, you have switched the socket into a mode 
> where it now has a whitelist of acceptable multicast groups, but if a socket 
> has no joined groups, it should receive all multicast traffic, not none.  
> This 
> change breaks that.
> 
> I did not find this behavior intuitive at first, but it does seem to be 
> required.  Note the description of IP_ADD_MEMBERSHIP from RFC 3678 for 
> example:


I agree getting a packet that is coming to your port without joining the
multi-cast group is not intuitive to me... 

> 
> 3.  Overview of APIs
> 
>   There are a number of different APIs described in this document that
>   are appropriate for a number of different application types and IP
>   versions.  Before providing detailed descriptions, this section
>   provides a "taxonomy" with a brief description of each.
> 
>   There are two categories of source-filter APIs, both of which are
>   designed to allow multicast receiver applications to designate the
>   unicast address(es) of sender(s) along with the multicast group
>   (destination address) to receive.
> 
>  o  Basic (Delta-based): Some applications desire the simplicity of
> a delta-based API in which each function call specifies a
> single source address which should be added to or removed from
> the existing filter for a given multicast group address on
> which to listen.  Such applications typically fall into either
> of two categories:
> 
> +  Any-Source Multicast: By default, all sources are accepted.
>Individual sources may be turned off and back on as needed
>over time.  This is also known as "exclude" mode, since the
>source filter contains a list of excluded sources.
> 
> +  Source-Specific Multicast: Only sources in a given list are
>allowed.  The list may change over time.  This is also known
>as "include" mode, since the source filter contains a list
>of included sources.
> 
>This API would be used, for example, by "single-source"
>applications such as audio/video broadcasting.  It would
>also be used for logical multi-source sessions where each
>source independently allocates its own Source-Specific
>Multicast group address.


Not the above document is talking about a receiver that as joined the
multicast group (or is joining it and wants some filtering)... I don't
see how that applies to a UDP socket that has NOT joined the M-cast group..

> 
> 
> .
> 
> 4.1.1.  IPv4 Any-Source Multicast API
> 
>   The following socket options are defined in  for
>   applications in the Any-Source Multicast category:
> 
>   Socket o

svn commit: r220155 - head/share/man/man9

2011-03-30 Thread Andrey V. Elsukov
Author: ae
Date: Wed Mar 30 11:34:40 2011
New Revision: 220155
URL: http://svn.freebsd.org/changeset/base/220155

Log:
  Remove duplicate sentence.

Modified:
  head/share/man/man9/sbuf.9

Modified: head/share/man/man9/sbuf.9
==
--- head/share/man/man9/sbuf.9  Wed Mar 30 08:22:29 2011(r220154)
+++ head/share/man/man9/sbuf.9  Wed Mar 30 11:34:40 2011(r220155)
@@ -395,10 +395,6 @@ returns the length of the un-drained dat
 returns non-zero if the
 .Fa sbuf
 is finished.
-.Fn sbuf_done
-returns non-zero if the
-.Fa sbuf
-is finished.
 .Sh NOTES
 If an operation caused an
 .Fa sbuf
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r217592 - head/sys/netinet

2011-03-30 Thread John Baldwin
On Wednesday, March 30, 2011 3:50:18 am Daniel Eischen wrote:
> On Tue, 29 Mar 2011, John Baldwin wrote:
> 
> > On Wednesday, January 19, 2011 2:07:16 pm Randall Stewart wrote:
> >> Author: rrs
> >> Date: Wed Jan 19 19:07:16 2011
> >> New Revision: 217592
> >> URL: http://svn.freebsd.org/changeset/base/217592
> >>
> >> Log:
> >>   Fix a bug where Multicast packets sent from a
> >>   udp endpoint may end up echoing back to the sender
> >>   even with OUT joining the multi-cast group.
> >>
> >>   Reviewed by: gnn, bms, bz?
> >>   Obtained from:   deischen (with help from)
> >>
> >> Modified:
> >>   head/sys/netinet/udp_usrreq.c
> >>
> >> Modified: head/sys/netinet/udp_usrreq.c
> >>
> > ==
> >> --- head/sys/netinet/udp_usrreq.c  Wed Jan 19 18:20:11 2011
> >> (r217591)
> >> +++ head/sys/netinet/udp_usrreq.c  Wed Jan 19 19:07:16 2011
> >> (r217592)
> >> @@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off)
> >> * and source-specific multicast. [RFC3678]
> >> */
> >>imo = inp->inp_moptions;
> >> -  if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) &&
> >> -  imo != NULL) {
> >> +  if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
> >>struct sockaddr_in   group;
> >>int  blocked;
> >> -
> >> +  if(imo == NULL) {
> >> +  INP_RUNLOCK(inp);
> >> +  continue;
> >> +  }
> >>bzero(&group, sizeof(struct sockaddr_in));
> >>group.sin_len = sizeof(struct sockaddr_in);
> >>group.sin_family = AF_INET;
> >
> > So it turns out that this is a feature, not a bug, and is how multicast has
> > always worked.  Specifically, if you bind a UDP socket with a wildcard
> > address, it should receive all traffic for the bound port, unicast or
> > multicast.  When you join a group, you have switched the socket into a mode
> > where it now has a whitelist of acceptable multicast groups, but if a socket
> > has no joined groups, it should receive all multicast traffic, not none.  
> > This
> > change breaks that.
> >
> > I did not find this behavior intuitive at first, but it does seem to be
> > required.  Note the description of IP_ADD_MEMBERSHIP from RFC 3678 for
> > example:
> >
> > 3.  Overview of APIs
> >
> >   There are a number of different APIs described in this document that
> >   are appropriate for a number of different application types and IP
> >   versions.  Before providing detailed descriptions, this section
> >   provides a "taxonomy" with a brief description of each.
> >
> >   There are two categories of source-filter APIs, both of which are
> >   designed to allow multicast receiver applications to designate the
> >   unicast address(es) of sender(s) along with the multicast group
> >   (destination address) to receive.
> >
> >  o  Basic (Delta-based): Some applications desire the simplicity of
> > a delta-based API in which each function call specifies a
> > single source address which should be added to or removed from
> > the existing filter for a given multicast group address on
> > which to listen.  Such applications typically fall into either
> > of two categories:
> >
> > +  Any-Source Multicast: By default, all sources are accepted.
> >Individual sources may be turned off and back on as needed
> >over time.  This is also known as "exclude" mode, since the
> >source filter contains a list of excluded sources.
> >
> > +  Source-Specific Multicast: Only sources in a given list are
> >allowed.  The list may change over time.  This is also known
> >as "include" mode, since the source filter contains a list
> >of included sources.
> >
> >This API would be used, for example, by "single-source"
> >applications such as audio/video broadcasting.  It would
> >also be used for logical multi-source sessions where each
> >source independently allocates its own Source-Specific
> >Multicast group address.
> >
> >
> > .
> >
> > 4.1.1.  IPv4 Any-Source Multicast API
> >
> >   The following socket options are defined in  for
> >   applications in the Any-Source Multicast category:
> >
> >   Socket option Argument type
> >   IP_ADD_MEMBERSHIP struct ip_mreq
> >   IP_BLOCK_SOURCE   struct ip_mreq_source
> >   IP_UNBLOCK_SOURCE struct ip_mreq_source
> >   IP_DROP_MEMBERSHIPstruct ip_mreq
> >
> >   IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP are already implemented on
> >   most operating systems, and are used to join and leave an any-so

Re: svn commit: r217592 - head/sys/netinet

2011-03-30 Thread John Baldwin
On Wednesday, March 30, 2011 7:27:36 am Randall Stewart wrote:
> John:
> 
> The original complaint on this came from Daniel... I believe he
> claimed that up until bms's multi-cast work.. you would NOT
> get a packet sent to you if you did not join the multi-cast group.

Not necessarily. :(  See below..

> I will also comment in-line below...
> 
> On Mar 29, 2011, at 2:01 PM, John Baldwin wrote:
> 
> > On Wednesday, January 19, 2011 2:07:16 pm Randall Stewart wrote:
> >> Author: rrs
> >> Date: Wed Jan 19 19:07:16 2011
> >> New Revision: 217592
> >> URL: http://svn.freebsd.org/changeset/base/217592
> >> 
> >> Log:
> >>  Fix a bug where Multicast packets sent from a
> >>  udp endpoint may end up echoing back to the sender
> >>  even with OUT joining the multi-cast group.
> >> 
> >>  Reviewed by:  gnn, bms, bz?
> >>  Obtained from:deischen (with help from)
> >> 
> >> Modified:
> >>  head/sys/netinet/udp_usrreq.c
> >> 
> >> Modified: head/sys/netinet/udp_usrreq.c
> >> 
> > ==
> >> --- head/sys/netinet/udp_usrreq.c  Wed Jan 19 18:20:11 2011
> >> (r217591)
> >> +++ head/sys/netinet/udp_usrreq.c  Wed Jan 19 19:07:16 2011
> >> (r217592)
> >> @@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off)
> >> * and source-specific multicast. [RFC3678]
> >> */
> >>imo = inp->inp_moptions;
> >> -  if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) &&
> >> -  imo != NULL) {
> >> +  if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
> >>struct sockaddr_in   group;
> >>int  blocked;
> >> -
> >> +  if(imo == NULL) {
> >> +  INP_RUNLOCK(inp);
> >> +  continue;
> >> +  }
> >>bzero(&group, sizeof(struct sockaddr_in));
> >>group.sin_len = sizeof(struct sockaddr_in);
> >>group.sin_family = AF_INET;
> > 
> > So it turns out that this is a feature, not a bug, and is how multicast has 
> > always worked.  Specifically, if you bind a UDP socket with a wildcard 
> > address, it should receive all traffic for the bound port, unicast or 
> > multicast.  When you join a group, you have switched the socket into a mode 
> > where it now has a whitelist of acceptable multicast groups, but if a 
> > socket 
> > has no joined groups, it should receive all multicast traffic, not none.  
> > This 
> > change breaks that.
> > 
> > I did not find this behavior intuitive at first, but it does seem to be 
> > required.  Note the description of IP_ADD_MEMBERSHIP from RFC 3678 for 
> > example:
> 
> 
> I agree getting a packet that is coming to your port without joining the
> multi-cast group is not intuitive to me... 
> 
> > 
> > 3.  Overview of APIs
> > 
> >   There are a number of different APIs described in this document that
> >   are appropriate for a number of different application types and IP
> >   versions.  Before providing detailed descriptions, this section
> >   provides a "taxonomy" with a brief description of each.
> > 
> >   There are two categories of source-filter APIs, both of which are
> >   designed to allow multicast receiver applications to designate the
> >   unicast address(es) of sender(s) along with the multicast group
> >   (destination address) to receive.
> > 
> >  o  Basic (Delta-based): Some applications desire the simplicity of
> > a delta-based API in which each function call specifies a
> > single source address which should be added to or removed from
> > the existing filter for a given multicast group address on
> > which to listen.  Such applications typically fall into either
> > of two categories:
> > 
> > +  Any-Source Multicast: By default, all sources are accepted.
> >Individual sources may be turned off and back on as needed
> >over time.  This is also known as "exclude" mode, since the
> >source filter contains a list of excluded sources.
> > 
> > +  Source-Specific Multicast: Only sources in a given list are
> >allowed.  The list may change over time.  This is also known
> >as "include" mode, since the source filter contains a list
> >of included sources.
> > 
> >This API would be used, for example, by "single-source"
> >applications such as audio/video broadcasting.  It would
> >also be used for logical multi-source sessions where each
> >source independently allocates its own Source-Specific
> >Multicast group address.
> 
> 
> Not the above document is talking about a receiver that as joined the
> multicast group (or is joining it and wants some filt

svn commit: r220156 - head/sys/netinet

2011-03-30 Thread John Baldwin
Author: jhb
Date: Wed Mar 30 12:35:39 2011
New Revision: 220156
URL: http://svn.freebsd.org/changeset/base/220156

Log:
  Clamp the initial advertised receive window when responding to a SYN/ACK
  to the maximum allowed window.  Growing the window too large would cause
  an underflow in the calculations in tcp_output() to decide if a window
  update should be sent which would prevent the persist timer from being
  started if data was pending and the other end of the connection advertised
  an initial window size of 0.
  
  PR:   kern/154006
  Submitted by: Stefan `Sec` Zehl  sec 42 org
  Reviewed by:  bz
  MFC after:1 week

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cWed Mar 30 11:34:40 2011
(r220155)
+++ head/sys/netinet/tcp_input.cWed Mar 30 12:35:39 2011
(r220156)
@@ -1756,7 +1756,8 @@ tcp_do_segment(struct mbuf *m, struct tc
(TF_RCVD_SCALE|TF_REQ_SCALE)) {
tp->rcv_scale = tp->request_r_scale;
}
-   tp->rcv_adv += tp->rcv_wnd;
+   tp->rcv_adv += imin(tp->rcv_wnd,
+   TCP_MAXWIN << tp->rcv_scale);
tp->snd_una++;  /* SYN is acked */
/*
 * If there's data, delay ACK; if there's also a FIN
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2011-03-30 Thread Sergey Kandaurov
Author: pluknet
Date: Wed Mar 30 14:15:18 2011
New Revision: 220157
URL: http://svn.freebsd.org/changeset/base/220157

Log:
  Use FD_CLOEXEC explicitly.
  
  MFC after:3 days

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

Modified: head/lib/libc/gen/syslog.c
==
--- head/lib/libc/gen/syslog.c  Wed Mar 30 12:35:39 2011(r220156)
+++ head/lib/libc/gen/syslog.c  Wed Mar 30 14:15:18 2011(r220157)
@@ -342,7 +342,7 @@ connectlog(void)
if (LogFile == -1) {
if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
return;
-   (void)_fcntl(LogFile, F_SETFD, 1);
+   (void)_fcntl(LogFile, F_SETFD, FD_CLOEXEC);
}
if (LogFile != -1 && status == NOCONN) {
SyslogAddr.sun_len = sizeof(SyslogAddr);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220158 - in head/sys: compat/freebsd32 kern sys

2011-03-30 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 30 14:46:12 2011
New Revision: 220158
URL: http://svn.freebsd.org/changeset/base/220158

Log:
  Provide compat32 shims for kldstat(2).
  
  Requested and tested by:  jpaetzel
  MFC after:1 week

Modified:
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/syscalls.master
  head/sys/kern/kern_linker.c
  head/sys/sys/syscallsubr.h

Modified: head/sys/compat/freebsd32/freebsd32.h
==
--- head/sys/compat/freebsd32/freebsd32.h   Wed Mar 30 14:15:18 2011
(r220157)
+++ head/sys/compat/freebsd32/freebsd32.h   Wed Mar 30 14:46:12 2011
(r220158)
@@ -336,4 +336,23 @@ struct kinfo_proc32 {
int ki_tdflags;
 };
 
+struct kld32_file_stat_1 {
+   int version;/* set to sizeof(struct kld_file_stat_1) */
+   charname[MAXPATHLEN];
+   int refs;
+   int id;
+   uint32_t address;   /* load address */
+   uint32_t size;  /* size in bytes */
+};
+
+struct kld32_file_stat {
+   int version;/* set to sizeof(struct kld_file_stat) */
+   charname[MAXPATHLEN];
+   int refs;
+   int id;
+   uint32_t address;   /* load address */
+   uint32_t size;  /* size in bytes */
+   charpathname[MAXPATHLEN];
+};
+
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Wed Mar 30 14:15:18 2011
(r220157)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Wed Mar 30 14:46:12 2011
(r220158)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include   /* Must come after sys/malloc.h */
@@ -2669,3 +2670,29 @@ freebsd32_copyout_strings(struct image_p
return ((register_t *)stack_base);
 }
 
+int
+freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap)
+{
+   struct kld_file_stat stat;
+   struct kld32_file_stat stat32;
+   int error, version;
+
+   if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
+   != 0)
+   return (error);
+   if (version != sizeof(struct kld32_file_stat_1) &&
+   version != sizeof(struct kld32_file_stat))
+   return (EINVAL);
+
+   error = kern_kldstat(td, uap->fileid, &stat);
+   if (error != 0)
+   return (error);
+
+   bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name));
+   CP(stat, stat32, refs);
+   CP(stat, stat32, id);
+   PTROUT_CP(stat, stat32, address);
+   CP(stat, stat32, size);
+   bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname));
+   return (copyout(&stat32, uap->stat, version));
+}

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Wed Mar 30 14:15:18 2011
(r220157)
+++ head/sys/compat/freebsd32/syscalls.master   Wed Mar 30 14:46:12 2011
(r220158)
@@ -533,8 +533,8 @@
 305AUE_MODUNLOAD   NOPROTO { int kldunload(int fileid); }
 306AUE_NULLNOPROTO { int kldfind(const char *file); }
 307AUE_NULLNOPROTO { int kldnext(int fileid); }
-308AUE_NULLNOPROTO { int kldstat(int fileid, \
-   struct kld_file_stat* stat); }
+308AUE_NULLSTD { int freebsd32_kldstat(int fileid, \
+   struct kld32_file_stat* stat); }
 309AUE_NULLNOPROTO { int kldfirstmod(int fileid); }
 310AUE_GETSID  NOPROTO { int getsid(pid_t pid); }
 311AUE_SETRESUID   NOPROTO { int setresuid(uid_t ruid, uid_t euid, \

Modified: head/sys/kern/kern_linker.c
==
--- head/sys/kern/kern_linker.c Wed Mar 30 14:15:18 2011(r220157)
+++ head/sys/kern/kern_linker.c Wed Mar 30 14:46:12 2011(r220158)
@@ -1201,29 +1201,39 @@ int
 kldstat(struct thread *td, struct kldstat_args *uap)
 {
struct kld_file_stat stat;
-   linker_file_t lf;
-   int error, namelen, version, version_num;
+   int error, version;
 
/*
 * Check the version of the user's structure.
 */
-   if ((error = copyin(&uap->stat->version, &version, sizeof(version))) != 
0)
+   if ((error = copyin(&uap->stat->version, &version, sizeof(version)))
+   != 0)
return (error);
-   if (version == sizeof(struct kld_file_stat_1))
-   version_num = 1;
-   else if (version == sizeof(struct kld_file_stat))
-   version_num = 2;
-   else
+   if (version != sizeof(struct kld_file_stat_1) &&
+   

svn commit: r220159 - head/sys/compat/freebsd32

2011-03-30 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 30 14:46:55 2011
New Revision: 220159
URL: http://svn.freebsd.org/changeset/base/220159

Log:
  Regen.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar 30 14:46:12 2011
(r220158)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar 30 14:46:55 2011
(r220159)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219304 
2011-03-05 12:40:35Z trasz 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220158 
2011-03-30 14:46:12Z kib 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -240,6 +240,10 @@ struct freebsd32_modstat_args {
char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)];
char stat_l_[PADL_(struct module_stat32 *)]; struct module_stat32 * 
stat; char stat_r_[PADR_(struct module_stat32 *)];
 };
+struct freebsd32_kldstat_args {
+   char fileid_l_[PADL_(int)]; int fileid; char fileid_r_[PADR_(int)];
+   char stat_l_[PADL_(struct kld32_file_stat *)]; struct kld32_file_stat * 
stat; char stat_r_[PADR_(struct kld32_file_stat *)];
+};
 struct freebsd32_aio_return_args {
char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char 
aiocbp_r_[PADR_(struct aiocb32 *)];
 };
@@ -607,6 +611,7 @@ int freebsd32_lutimes(struct thread *, s
 intfreebsd32_preadv(struct thread *, struct freebsd32_preadv_args *);
 intfreebsd32_pwritev(struct thread *, struct freebsd32_pwritev_args *);
 intfreebsd32_modstat(struct thread *, struct freebsd32_modstat_args *);
+intfreebsd32_kldstat(struct thread *, struct freebsd32_kldstat_args *);
 intfreebsd32_aio_return(struct thread *, struct freebsd32_aio_return_args 
*);
 intfreebsd32_aio_suspend(struct thread *, struct 
freebsd32_aio_suspend_args *);
 intfreebsd32_aio_cancel(struct thread *, struct freebsd32_aio_cancel_args 
*);
@@ -939,6 +944,7 @@ int freebsd7_freebsd32_shmctl(struct thr
 #defineFREEBSD32_SYS_AUE_freebsd32_pwritev AUE_PWRITEV
 #defineFREEBSD32_SYS_AUE_freebsd4_freebsd32_fhstatfs   AUE_FHSTATFS
 #defineFREEBSD32_SYS_AUE_freebsd32_modstat AUE_NULL
+#defineFREEBSD32_SYS_AUE_freebsd32_kldstat AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_aio_return  AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_aio_suspend AUE_NULL
 #defineFREEBSD32_SYS_AUE_freebsd32_aio_cancel  AUE_NULL

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Wed Mar 30 14:46:12 
2011(r220158)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Wed Mar 30 14:46:55 
2011(r220159)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219304 
2011-03-05 12:40:35Z trasz 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220158 
2011-03-30 14:46:12Z kib 
  */
 
 #defineFREEBSD32_SYS_syscall   0
@@ -234,7 +234,7 @@
 #defineFREEBSD32_SYS_kldunload 305
 #defineFREEBSD32_SYS_kldfind   306
 #defineFREEBSD32_SYS_kldnext   307
-#defineFREEBSD32_SYS_kldstat   308
+#defineFREEBSD32_SYS_freebsd32_kldstat 308
 #defineFREEBSD32_SYS_kldfirstmod   309
 #defineFREEBSD32_SYS_getsid310
 #defineFREEBSD32_SYS_setresuid 311

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Wed Mar 30 14:46:12 
2011(r220158)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Wed Mar 30 14:46:55 
2011(r220159)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219304 
2011-03-05 12:40:35Z trasz 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220158 
2011-03-30 14:46:12Z kib 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -318,7 +318,7 @@ const char *freebsd32_syscallnames[] = {
"kldunload",/* 305 = kldunload */
"kldfind",  /* 306 = kldfind */
"kldnext",  /* 307 = kldnext */
-   "kldstat",  /* 308 = kldstat */
+   "freebsd32_kldstat",/* 308 = freebsd32_kldstat */
"kldfirstmod", 

Re: svn commit: r217592 - head/sys/netinet

2011-03-30 Thread Daniel Eischen

On Wed, 30 Mar 2011, John Baldwin wrote:


On Wednesday, March 30, 2011 3:50:18 am Daniel Eischen wrote:

On Tue, 29 Mar 2011, John Baldwin wrote:


As to why the packets loop back to the receiver, I believe that is a separate
issue on the output side, not the receive side.


That may be, but the behavior is undesired if the no process
on the system has joined the multicast group.  I believe it
was broke with r189359, and the comment in the code that broke
it says:

/*
 * Loop back multicast datagram if not expressly
 * forbidden to do so, even if we are not a member
 * of the group; ip_input() will filter it later,
 * thus deferring a hash lookup and mutex acquisition
 * at the expense of a cheap copy using m_copym().
 */

The previous revision did a lookup of the multicast address
and looped it if an entry was found for it.


Well, for one, this patch changes the behavior even if there is a socket
joined to the group.


Yes, I understand that.  But before this patch, the behavior
was correct for what you have stated, and for my particular
case.  When we fixed the problem, we took BMS' comment as
guidance and filtered on the input side.


 However, I suspect that in your case your app should
probably be turning IP_MULTICAST_LOOP off explicitly regardless of what the
changes end up being (or do you write to multiple groups and want a subset
of those groups to loop back?).


In the _absence_ of setting multicast loopback on the socket,
we should not be getting looped-back packets.  This is
the behavior we've seen on other OS's.

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


Re: svn commit: r217592 - head/sys/netinet

2011-03-30 Thread Daniel Eischen

On Wed, 30 Mar 2011, John Baldwin wrote:


On Wednesday, March 30, 2011 7:27:36 am Randall Stewart wrote:

John:

The original complaint on this came from Daniel... I believe he
claimed that up until bms's multi-cast work.. you would NOT
get a packet sent to you if you did not join the multi-cast group.


Not necessarily. :(  See below..


I will also comment in-line below...

On Mar 29, 2011, at 2:01 PM, John Baldwin wrote:


On Wednesday, January 19, 2011 2:07:16 pm Randall Stewart wrote:

Author: rrs
Date: Wed Jan 19 19:07:16 2011
New Revision: 217592
URL: http://svn.freebsd.org/changeset/base/217592

Log:
 Fix a bug where Multicast packets sent from a
 udp endpoint may end up echoing back to the sender
 even with OUT joining the multi-cast group.

 Reviewed by:   gnn, bms, bz?
 Obtained from: deischen (with help from)

Modified:
 head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c


==

--- head/sys/netinet/udp_usrreq.c   Wed Jan 19 18:20:11 2011
(r217591)
+++ head/sys/netinet/udp_usrreq.c   Wed Jan 19 19:07:16 2011
(r217592)
@@ -479,11 +479,13 @@ udp_input(struct mbuf *m, int off)
 * and source-specific multicast. [RFC3678]
 */
imo = inp->inp_moptions;
-   if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) &&
-   imo != NULL) {
+   if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
struct sockaddr_in   group;
int  blocked;
-
+   if(imo == NULL) {
+   INP_RUNLOCK(inp);
+   continue;
+   }
bzero(&group, sizeof(struct sockaddr_in));
group.sin_len = sizeof(struct sockaddr_in);
group.sin_family = AF_INET;


So it turns out that this is a feature, not a bug, and is how multicast has
always worked.  Specifically, if you bind a UDP socket with a wildcard
address, it should receive all traffic for the bound port, unicast or
multicast.  When you join a group, you have switched the socket into a mode
where it now has a whitelist of acceptable multicast groups, but if a socket
has no joined groups, it should receive all multicast traffic, not none.  This
change breaks that.

I did not find this behavior intuitive at first, but it does seem to be
required.  Note the description of IP_ADD_MEMBERSHIP from RFC 3678 for
example:



I agree getting a packet that is coming to your port without joining the
multi-cast group is not intuitive to me...



3.  Overview of APIs

  There are a number of different APIs described in this document that
  are appropriate for a number of different application types and IP
  versions.  Before providing detailed descriptions, this section
  provides a "taxonomy" with a brief description of each.

  There are two categories of source-filter APIs, both of which are
  designed to allow multicast receiver applications to designate the
  unicast address(es) of sender(s) along with the multicast group
  (destination address) to receive.

 o  Basic (Delta-based): Some applications desire the simplicity of
a delta-based API in which each function call specifies a
single source address which should be added to or removed from
the existing filter for a given multicast group address on
which to listen.  Such applications typically fall into either
of two categories:

+  Any-Source Multicast: By default, all sources are accepted.
   Individual sources may be turned off and back on as needed
   over time.  This is also known as "exclude" mode, since the
   source filter contains a list of excluded sources.

+  Source-Specific Multicast: Only sources in a given list are
   allowed.  The list may change over time.  This is also known
   as "include" mode, since the source filter contains a list
   of included sources.

   This API would be used, for example, by "single-source"
   applications such as audio/video broadcasting.  It would
   also be used for logical multi-source sessions where each
   source independently allocates its own Source-Specific
   Multicast group address.



Not the above document is talking about a receiver that as joined the
multicast group (or is joining it and wants some filtering)... I don't
see how that applies to a UDP socket that has NOT joined the M-cast group..




.

4.1.1.  IPv4 Any-Source Multicast API

  The following socket options are defined in  for
  applications in the Any-Source Multicast category:

  Socket option Argument type
  IP_ADD_MEMBERSHIP  

svn commit: r220161 - head/usr.sbin/pc-sysinstall/backend

2011-03-30 Thread Josh Paetzel
Author: jpaetzel
Date: Wed Mar 30 17:33:52 2011
New Revision: 220161
URL: http://svn.freebsd.org/changeset/base/220161

Log:
  Fix syntax error from previous commit.
  
  Approved by:  kib (mentor)

Modified:
  head/usr.sbin/pc-sysinstall/backend/functions-disk.sh

Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh
==
--- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh   Wed Mar 30 
14:48:49 2011(r220160)
+++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh   Wed Mar 30 
17:33:52 2011(r220161)
@@ -421,7 +421,7 @@ setup_disk_slice()
 
 # Check if we have an image file defined
 echo $line | grep -q "^image=" 2>/dev/null
-if [ $? eq 0 ] ; then
+if [ $? -eq 0 ] ; then
   # Found an image= entry, lets read / set it
   get_value_from_string "${line}"
   strip_white_space "$VAL"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220162 - head/usr.sbin/pc-sysinstall/backend-partmanager

2011-03-30 Thread Josh Paetzel
Author: jpaetzel
Date: Wed Mar 30 17:37:04 2011
New Revision: 220162
URL: http://svn.freebsd.org/changeset/base/220162

Log:
  Check in two missing files missed in cleanup.
  Change expr to $(())
  Switch test from "$?" = "0" to $? -eq 0
  
  Approved by:  kib (mentor)

Modified:
  head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh
  head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh

Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh
==
--- head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh  Wed Mar 
30 17:33:52 2011(r220161)
+++ head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh  Wed Mar 
30 17:37:04 2011(r220162)
@@ -85,7 +85,7 @@ fi
 
 # If this is an empty disk, see if we need to create a new scheme for it
 gpart show ${DISK} >/dev/null 2>/dev/null
-if [ "$?" != "0" -a "${SLICENUM}" = "1" ] ; then
+if [ $? -eq 0 -a "${SLICENUM}" = "1" ] ; then
  gpart create -s ${TYPE} ${DISK}
 fi
 

Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh
==
--- head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh  Wed Mar 
30 17:33:52 2011(r220161)
+++ head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh  Wed Mar 
30 17:37:04 2011(r220162)
@@ -57,10 +57,10 @@ PARTINDEX=""
 while 
 z=1
 do
-  CHARS=`expr $CHARS - 1`
+  CHARS=$((CHARS-1))
   LAST_CHAR=`echo "${PARTITION}" | cut -c $CHARS`
-  echo "${LAST_CHAR}" | grep "^[0-9]$" >/dev/null 2>/dev/null
-  if [ "$?" = "0" ] ; then
+  echo "${LAST_CHAR}" | grep -q "^[0-9]$" 2>/dev/null
+  if [ $? -eq 0 ] ; then
 PARTINDEX="${LAST_CHAR}${PARTINDEX}"
   else
 break
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220163 - in head/sys: compat/freebsd32 conf kern sys

2011-03-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 30 17:48:15 2011
New Revision: 220163
URL: http://svn.freebsd.org/changeset/base/220163

Log:
  Add rctl.  It's used by racct to take user-configurable actions based
  on the set of rules it maintains and the current resource usage.  It also
  privides userland API to manage that ruleset.
  
  Sponsored by: The FreeBSD Foundation
  Reviewed by:  kib (earlier version)

Added:
  head/sys/kern/kern_rctl.c   (contents, props changed)
  head/sys/sys/rctl.h   (contents, props changed)
Modified:
  head/sys/compat/freebsd32/syscalls.master
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/kern/kern_jail.c
  head/sys/kern/syscalls.master
  head/sys/sys/priv.h

Modified: head/sys/compat/freebsd32/syscalls.master
==
--- head/sys/compat/freebsd32/syscalls.master   Wed Mar 30 17:37:04 2011
(r220162)
+++ head/sys/compat/freebsd32/syscalls.master   Wed Mar 30 17:48:15 2011
(r220163)
@@ -965,3 +965,18 @@
 523AUE_NULLNOPROTO { int getloginclass(char *namebuf, \
size_t namelen); }
 524AUE_NULLNOPROTO { int setloginclass(const char *namebuf); }
+525AUE_NULLNOPROTO { int rctl_get_racct(const void *inbufp, \
+   size_t inbuflen, void *outbufp, \
+   size_t outbuflen); }
+526AUE_NULLNOPROTO { int rctl_get_rules(const void *inbufp, \
+   size_t inbuflen, void *outbufp, \
+   size_t outbuflen); }
+527AUE_NULLNOPROTO { int rctl_get_limits(const void *inbufp, \
+   size_t inbuflen, void *outbufp, \
+   size_t outbuflen); }
+528AUE_NULLNOPROTO { int rctl_add_rule(const void *inbufp, \
+   size_t inbuflen, void *outbufp, \
+   size_t outbuflen); }
+529AUE_NULLNOPROTO { int rctl_remove_rule(const void *inbufp, \
+   size_t inbuflen, void *outbufp, \
+   size_t outbuflen); }

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Mar 30 17:37:04 2011(r220162)
+++ head/sys/conf/NOTES Wed Mar 30 17:48:15 2011(r220163)
@@ -2933,6 +2933,9 @@ options   AAC_DEBUG   # Debugging levels:
 # Resource Accounting
 optionsRACCT
 
+# Resource Limits
+optionsRCTL
+
 # Yet more undocumented options for linting.
 # BKTR_ALLOC_PAGES has no effect except to cause warnings, and
 # BROOKTREE_ALLOC_PAGES hasn't actually been superseded by it, since the

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Mar 30 17:37:04 2011(r220162)
+++ head/sys/conf/files Wed Mar 30 17:48:15 2011(r220163)
@@ -2226,6 +2226,7 @@ kern/kern_priv.c  standard
 kern/kern_proc.c   standard
 kern/kern_prot.c   standard
 kern/kern_racct.c  standard
+kern/kern_rctl.c   standard
 kern/kern_resource.c   standard
 kern/kern_rmlock.c standard
 kern/kern_rwlock.c standard

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Wed Mar 30 17:37:04 2011(r220162)
+++ head/sys/conf/options   Wed Mar 30 17:48:15 2011(r220163)
@@ -876,6 +876,9 @@ IPOIB_CMopt_ofed.h
 # Resource Accounting
 RACCT  opt_global.h
 
+# Resource Limits
+RCTL   opt_global.h
+
 # At least one of the AR71XX ubiquiti boards has a Redboot configuration
 # that "lies" about the amount of RAM it has. Until a cleaner method is
 # defined, this option will suffice in overriding what Redboot says.

Modified: head/sys/kern/kern_jail.c
==
--- head/sys/kern/kern_jail.c   Wed Mar 30 17:37:04 2011(r220162)
+++ head/sys/kern/kern_jail.c   Wed Mar 30 17:48:15 2011(r220163)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2532,6 +2533,9 @@ prison_deref(struct prison *pr, int flag
if (pr->pr_cpuset != NULL)
cpuset_rel(pr->pr_cpuset);
osd_jail_exit(pr);
+#ifdef RCTL
+   rctl_racct_release(pr->pr_racct);
+#endif
racct_destroy(&pr->pr_racct);
free(pr, M_PRISON);
 

Added: head/sys/kern/kern_rctl.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/kern/kern_rctl.c   

svn commit: r220164 - in head/sys: compat/freebsd32 kern sys

2011-03-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 30 17:59:54 2011
New Revision: 220164
URL: http://svn.freebsd.org/changeset/base/220164

Log:
  Regenerate.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_systrace_args.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar 30 17:48:15 2011
(r220163)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar 30 17:59:54 2011
(r220164)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220158 
2011-03-30 14:46:12Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220163 
2011-03-30 17:48:15Z trasz 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Wed Mar 30 17:48:15 
2011(r220163)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Wed Mar 30 17:59:54 
2011(r220164)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220158 
2011-03-30 14:46:12Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220163 
2011-03-30 17:48:15Z trasz 
  */
 
 #defineFREEBSD32_SYS_syscall   0
@@ -414,4 +414,9 @@
 #defineFREEBSD32_SYS_freebsd32_pselect 522
 #defineFREEBSD32_SYS_getloginclass 523
 #defineFREEBSD32_SYS_setloginclass 524
-#defineFREEBSD32_SYS_MAXSYSCALL525
+#defineFREEBSD32_SYS_rctl_get_racct525
+#defineFREEBSD32_SYS_rctl_get_rules526
+#defineFREEBSD32_SYS_rctl_get_limits   527
+#defineFREEBSD32_SYS_rctl_add_rule 528
+#defineFREEBSD32_SYS_rctl_remove_rule  529
+#defineFREEBSD32_SYS_MAXSYSCALL530

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Wed Mar 30 17:48:15 
2011(r220163)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Wed Mar 30 17:59:54 
2011(r220164)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220158 
2011-03-30 14:46:12Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220163 
2011-03-30 17:48:15Z trasz 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -548,4 +548,9 @@ const char *freebsd32_syscallnames[] = {
"freebsd32_pselect",/* 522 = freebsd32_pselect */
"getloginclass",/* 523 = getloginclass */
"setloginclass",/* 524 = setloginclass */
+   "rctl_get_racct",   /* 525 = rctl_get_racct */
+   "rctl_get_rules",   /* 526 = rctl_get_rules */
+   "rctl_get_limits",  /* 527 = rctl_get_limits */
+   "rctl_add_rule",/* 528 = rctl_add_rule */
+   "rctl_remove_rule", /* 529 = rctl_remove_rule */
 };

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cWed Mar 30 17:48:15 
2011(r220163)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cWed Mar 30 17:59:54 
2011(r220164)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220158 
2011-03-30 14:46:12Z kib 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 220163 
2011-03-30 17:48:15Z trasz 
  */
 
 #include "opt_compat.h"
@@ -585,4 +585,9 @@ struct sysent freebsd32_sysent[] = {
{ AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, 
AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC },   /* 522 = freebsd32_pselect */
{ AS(getloginclass_args), (sy_call_t *)getloginclass, AUE_NULL, NULL, 
0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */
{ AS(setloginclass_args), (sy_call_t *)setloginclass, AUE_NULL, NULL, 
0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */
+   { AS(rctl_get_racct_args), (sy_call_t *)rctl_get_racct, AUE_NULL, NULL, 
0, 0, 0, SY_

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

2011-03-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 30 18:08:31 2011
New Revision: 220165
URL: http://svn.freebsd.org/changeset/base/220165

Log:
  Expose the rctl(2) API in libc.

Modified:
  head/lib/libc/sys/Symbol.map

Modified: head/lib/libc/sys/Symbol.map
==
--- head/lib/libc/sys/Symbol.mapWed Mar 30 17:59:54 2011
(r220164)
+++ head/lib/libc/sys/Symbol.mapWed Mar 30 18:08:31 2011
(r220165)
@@ -364,6 +364,11 @@ FBSD_1.2 {
cap_enter;
cap_getmode;
getloginclass;
+   rctl_get_racct;
+   rctl_get_rules;
+   rctl_get_limits;
+   rctl_add_rule;
+   rctl_remove_rule;
setloginclass;
 };
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220166 - in head/usr.bin: . rctl

2011-03-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 30 18:27:52 2011
New Revision: 220166
URL: http://svn.freebsd.org/changeset/base/220166

Log:
  Add rctl(8), the utility to manage rctl rules.
  
  Sponsored by: The FreeBSD Foundation
  Reviewed by:  kib (earlier version)

Added:
  head/usr.bin/rctl/
  head/usr.bin/rctl/Makefile   (contents, props changed)
  head/usr.bin/rctl/rctl.8   (contents, props changed)
  head/usr.bin/rctl/rctl.c   (contents, props changed)
Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Wed Mar 30 18:08:31 2011(r220165)
+++ head/usr.bin/Makefile   Wed Mar 30 18:27:52 2011(r220166)
@@ -126,6 +126,7 @@ SUBDIR= alias \
printenv \
printf \
procstat \
+   rctl \
renice \
rev \
revoke \

Added: head/usr.bin/rctl/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/rctl/Makefile  Wed Mar 30 18:27:52 2011(r220166)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+PROG=   rctl
+MAN=   rctl.8
+
+DPADD= ${LIBUTIL}
+LDADD= -lutil
+
+WARNS?=6
+
+.include 

Added: head/usr.bin/rctl/rctl.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/rctl/rctl.8Wed Mar 30 18:27:52 2011(r220166)
@@ -0,0 +1,200 @@
+.\"-
+.\" Copyright (c) 2009 Edward Tomasz Napierala
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd February 13, 2011
+.Dt RCTL 8
+.Os
+.Sh NAME
+.Nm rctl
+.Nd display and update resource limits database
+.Sh SYNOPSIS
+.Nm
+.Op Fl h
+.Op Fl n
+.Op Ar filter
+.Nm
+.Fl a
+.Op Ar rule
+.Nm
+.Op Fl h
+.Op Fl n
+.Fl l
+.Op Ar filter
+.Nm
+.Fl r
+.Op Ar filter
+.Nm
+.Op Fl h
+.Fl u
+.Op Ar filter
+.Sh DESCRIPTION
+When called without options, the
+.Nm
+command writes currently defined RCTL rules to standard output.
+.Pp
+If a
+.Ar filter
+argument is specified, only rules matching the filter are displayed.
+The options are as follows:
+.Bl -tag -width indent
+.It Fl a Ar rule
+Add
+.Ar rule
+to the RCTL database.
+.It Fl l Ar filter
+Display rules applicable to the process defined by
+.Ar filter .
+.It Fl r Ar filter
+Remove rules matching
+.Ar filter
+from the RCTL database.
+.It Fl u Ar filter
+Display resource usage for a subject (process, user, login class
+or jail) matching the
+.Ar filter .
+.It Fl h
+"Human-readable" output.
+Use unit suffixes: Byte, Kilobyte, Megabyte,
+Gigabyte, Terabyte and Petabyte.
+.It Fl n
+Display user IDs numerically rather than converting them to a user name.
+.Pp
+.Sh RULE SYNTAX
+Syntax for a rule is subject:subject-id:resource:action=amount/per.
+.Pp
+Subject defines the kind of entity the rule applies to.
+It can be either process, user, login class, or jail.
+.Pp
+Subject ID identifies the subject.  It can be user name,
+numerical user ID, login class name, jail name, or numerical jail ID.
+.Pp
+Resource identifies the resource the rule controls.
+.Pp
+Action defines what will happen when a process exceeds the allowed amount.
+.Pp
+Amount defines how much of the resource a process can use before
+the defined action triggers.
+.Pp
+The per field defines what entity the amount gets accounted for.
+For example, rule "loginclass:users:vmem:deny=100M/process" means
+that each process of any user belonging to login class "users" may allocate
+up to 100MB of virtual memory.
+Rule "loginclass:users:vmem:deny=100M/user" would mean 

Re: svn commit: r217592 - head/sys/netinet

2011-03-30 Thread John Baldwin
On Wednesday, March 30, 2011 11:42:01 am Daniel Eischen wrote:
> > BMS preserved this behavior and your patch changes
> 
> But he changed the behavior on output.  Pre-BMS and post-BMS
> behave differently and not like Solaris 10 or VxWorks.  Haven't
> tried Linux.

Yes, I am not debating that.  I'm merely talking about the input side.

> > it.  UDP sockets start off with inp_moptions == NULL, so if you never do any
> > multicast-related setsockopt() you will receive all matching multicast 
> > packets.
> > However, once you do any multicast-related setsockopt() (IP_MULTICAST_LOOP,
> > IP_ADD_MEMBERSHIP, etc.) then inp_moptions is allocated and is non-NULL.
> > At that point it only accepts packets that match, except that even then we
> > used a sysctl which defaulted to off (!) to see if we should check the list 
> > of
> > memberships (net.inet.udp.strict_mcast_mship).  This options structure was 
> > never
> > free'd, however, so you could get the truly bizarre behavior of:
> >
> > - bind a new socket, it will not receive all matching multicast traffic
> > - use IP_ADD_MEMBERSHIP to add a group, it will now receive only matching 
> > multicast
> >  traffic for the group
> > - use IP_DROP_MEMBERSHIP to remove the group, it will now receive no 
> > multicast
> >  traffic
> >
> > The different behavior in states 1 and 3 I find confusing and odd.  By 
> > default
> > all sockets just always received all matching multicast traffic though. :)
> 
> Not if a multicast group was not joined.  The pre-BMS changes
> did not loop back multicast packets in ip_output.c.

Well, they would receive all multicast traffic that wasn't loopback traffic.
That is, if I had two sockets bound to *:2000 and *:4000 and one socket joined
a group 224.1.2.3, then both sockets would receive traffic bound for 224.1.2.3
if it matched their ports in both the pre-BMS code and in post-BMS but pre-RRS.
Now only the socket that did the join will receive the packets, so it is a
change in behavior.

Now I find this unintuitive, but other folks I have talked to have pointed out
that that could be a valid interpretation of binding to INADDR_ANY.

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


svn commit: r220167 - head/etc/rc.d

2011-03-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 30 18:32:45 2011
New Revision: 220167
URL: http://svn.freebsd.org/changeset/base/220167

Log:
  Add startup script, to load rules from /etc/rctl.conf.
  
  Sponsored by: The FreeBSD Foundation
  Reviewed by:  kib (ealier version)

Added:
  head/etc/rc.d/rctl   (contents, props changed)
Modified:
  head/etc/rc.d/Makefile

Modified: head/etc/rc.d/Makefile
==
--- head/etc/rc.d/Makefile  Wed Mar 30 18:27:52 2011(r220166)
+++ head/etc/rc.d/Makefile  Wed Mar 30 18:32:45 2011(r220167)
@@ -29,7 +29,7 @@ FILES=DAEMON FILESYSTEMS LOGIN NETWORKI
pf pflog pfsync \
powerd power_profile ppp pppoed pwcheck \
quota \
-   random rarpd resolv rfcomm_pppd_server root \
+   random rarpd rctl resolv rfcomm_pppd_server root \
route6d routed routing rpcbind rtadvd rtsold rwho \
savecore sdpd securelevel sendmail \
serial sppp statd static_arp stf swap1 \

Added: head/etc/rc.d/rctl
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/rc.d/rctl  Wed Mar 30 18:32:45 2011(r220167)
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: rctl
+# BEFORE: LOGIN
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="rctl"
+start_cmd="rctl_start"
+stop_cmd="rctl_stop"
+
+rctl_start()
+{
+   if [ -f /etc/rctl.conf ]; then
+   while read var comments
+   do
+   case ${var} in
+   \#*|'')
+   ;;
+   *)
+   rctl -a "${var}"
+   ;;
+   esac
+   done < /etc/rctl.conf
+   fi
+}
+
+rctl_stop()
+{
+
+   rctl -r :
+}
+
+load_rc_config $name
+run_rc_command "$1"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220168 - head/etc

2011-03-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 30 18:35:02 2011
New Revision: 220168
URL: http://svn.freebsd.org/changeset/base/220168

Log:
  Add example devd.conf entry.

Modified:
  head/etc/devd.conf

Modified: head/etc/devd.conf
==
--- head/etc/devd.conf  Wed Mar 30 18:32:45 2011(r220167)
+++ head/etc/devd.conf  Wed Mar 30 18:35:02 2011(r220168)
@@ -301,6 +301,7 @@ detach 10 {
 # Button:  Button pressed (0 for power, 1 for sleep)
 # CMBAT:   ACPI battery events
 # Lid: Lid state (0 is closed, 1 is open)
+# RCTL:Resource limits
 # Suspend, Resume: Suspend and resume notification
 # Thermal: ACPI thermal zone events
 #
@@ -313,4 +314,13 @@ notify 10 {
match "subsystem"   "ACAD";
action  "/etc/acpi_ac $notify";
 };
+
+# This example works around a memory leak in PostgreSQL, restarting
+# it when "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered.
+notify 0 {
+   match "system"  "RCTL";
+   match "rule""user:70:swap:.*";
+   action  "/usr/local/etc/rc.d/postgresql restart"
+};
+
 */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220169 - head/usr.bin/rctl

2011-03-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Mar 30 20:13:55 2011
New Revision: 220169
URL: http://svn.freebsd.org/changeset/base/220169

Log:
  Fix grammar and bump date.
  
  Submitted by: trociny

Modified:
  head/usr.bin/rctl/rctl.8

Modified: head/usr.bin/rctl/rctl.8
==
--- head/usr.bin/rctl/rctl.8Wed Mar 30 18:35:02 2011(r220168)
+++ head/usr.bin/rctl/rctl.8Wed Mar 30 20:13:55 2011(r220169)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 13, 2011
+.Dd March 30, 2011
 .Dt RCTL 8
 .Os
 .Sh NAME
@@ -105,7 +105,7 @@ that each process of any user belonging 
 up to 100MB of virtual memory.
 Rule "loginclass:users:vmem:deny=100M/user" would mean that for each
 user belonging to the login class "users", the sum of virtual memory allocated
-by all the processes of a that user will not exceed 100MB.
+by all the processes of that user will not exceed 100MB.
 Rule "loginclass:users:vmem:deny=100M/loginclass" would mean that the sum of
 virtual memory allocated by all processes of all users belonging to that login
 class will not exceed 100MB.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220172 - head/usr.sbin/tzsetup

2011-03-30 Thread Edwin Groothuis
Author: edwin
Date: Wed Mar 30 21:33:23 2011
New Revision: 220172
URL: http://svn.freebsd.org/changeset/base/220172

Log:
  Add a menu entry for UTC in the main menu.
  
  PR:   bin/156019
  Submitted by: Daniel O'Conner
  Reviewed by:  Garrett Cooper 
  MFC after:1 week

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

Modified: head/usr.sbin/tzsetup/tzsetup.c
==
--- head/usr.sbin/tzsetup/tzsetup.c Wed Mar 30 21:22:25 2011
(r220171)
+++ head/usr.sbin/tzsetup/tzsetup.c Wed Mar 30 21:33:23 2011
(r220172)
@@ -66,10 +66,13 @@ static int usedialog = 1;
 static char *chrootenv = NULL;
 
 static voidusage(void);
+static int confirm_zone(const char *filename);
 static int continent_country_menu(dialogMenuItem *);
+static int install_zoneinfo_file(const char *zoneinfo_file);
 static int set_zone_multi(dialogMenuItem *);
 static int set_zone_whole_country(dialogMenuItem *);
 static int set_zone_menu(dialogMenuItem *);
+static int set_zone_utc(void);
 
 struct continent {
dialogMenuItem *menu;
@@ -79,7 +82,7 @@ struct continent {
 };
 
 static struct continentafrica, america, antarctica, arctic, asia, 
atlantic;
-static struct continentaustralia, europe, indian, pacific;
+static struct continentaustralia, europe, indian, pacific, utc;
 
 static struct continent_names {
const char  *name;
@@ -94,7 +97,8 @@ static struct continent_names {
{ "Australia",  &australia },
{ "Europe", &europe },
{ "Indian", &indian },
-   { "Pacific",&pacific }
+   { "Pacific",&pacific },
+   { "UTC",&utc }
 };
 
 static struct continent_items {
@@ -110,7 +114,8 @@ static struct continent_items {
{ "7",  "Australia" },
{ "8",  "Europe" },
{ "9",  "Indian Ocean" },
-   { "0",  "Pacific Ocean" }
+   { "0",  "Pacific Ocean" },
+   { "a",  "UTC" }
 };
 
 #defineNCONTINENTS \
@@ -128,6 +133,9 @@ continent_country_menu(dialogMenuItem *c
int menulen;
int rv;
 
+   if (strcmp(continent->title, "UTC") == 0)
+   return set_zone_utc();  
+
/* Short cut -- if there's only one country, don't post a menu. */
if (contp->nitems == 1)
return (contp->menu[0].fire(&contp->menu[0]));
@@ -502,6 +510,15 @@ set_zone_menu(dialogMenuItem *dmi)
return (DITEM_LEAVE_MENU);
 }
 
+int
+set_zone_utc(void)
+{
+   if (!confirm_zone(NULL))
+   return (DITEM_FAILURE | DITEM_RECREATE);
+   
+   return (install_zoneinfo_file(NULL));
+}
+
 static int
 install_zoneinfo_file(const char *zoneinfo_file)
 {
@@ -526,7 +543,8 @@ install_zoneinfo_file(const char *zonein
else
snprintf(prompt, sizeof(prompt),
"Creating symbolic link %s to %s",
-   path_localtime, zoneinfo_file);
+   path_localtime,
+   zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file);
if (usedialog)
dialog_notify(prompt);
else
@@ -534,6 +552,22 @@ install_zoneinfo_file(const char *zonein
 #endif
 
if (reallydoit) {
+   if (zoneinfo_file == NULL) {
+   if (unlink(path_localtime) < 0 && errno != ENOENT) {
+   snprintf(title, sizeof(title), "Error");
+   snprintf(prompt, sizeof(prompt),
+"Could not delete %s: %s", path_localtime,
+strerror(errno));
+   if (usedialog)
+   dialog_mesgbox(title, prompt, 8, 72);
+   else
+   fprintf(stderr, "%s\n", prompt);
+
+   return (DITEM_FAILURE | DITEM_RECREATE);
+   }
+   return (DITEM_LEAVE_MENU);
+   }
+   
if (copymode) {
fd1 = open(zoneinfo_file, O_RDONLY, 0);
if (fd1 < 0) {
@@ -656,7 +690,7 @@ confirm_zone(const char *filename)
struct tm   *tm;
int rv;

-   setenv("TZ", filename, 1);
+   setenv("TZ", filename == NULL ? "" : filename, 1);
tzset();
tm = localtime(&t);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220173 - head/sys/geom/gate

2011-03-30 Thread Mikolaj Golub
Author: trociny
Date: Wed Mar 30 21:40:14 2011
New Revision: 220173
URL: http://svn.freebsd.org/changeset/base/220173

Log:
  Increase debug level on g_gate device destruction and add message on
  device creation.
  
  Suggested by: danger
  Approved by:  pjd (mentor)
  MFC after:3 days

Modified:
  head/sys/geom/gate/g_gate.c

Modified: head/sys/geom/gate/g_gate.c
==
--- head/sys/geom/gate/g_gate.c Wed Mar 30 21:33:23 2011(r220172)
+++ head/sys/geom/gate/g_gate.c Wed Mar 30 21:40:14 2011(r220173)
@@ -136,7 +136,7 @@ g_gate_destroy(struct g_gate_softc *sc, 
mtx_unlock(&g_gate_units_lock);
mtx_destroy(&sc->sc_queue_mtx);
g_topology_lock();
-   G_GATE_DEBUG(0, "Device %s destroyed.", gp->name);
+   G_GATE_DEBUG(1, "Device %s destroyed.", gp->name);
gp->softc = NULL;
g_wither_geom(gp, ENXIO);
sc->sc_provider = NULL;
@@ -438,6 +438,7 @@ g_gate_create(struct g_gate_ctl_create *
mtx_lock(&g_gate_units_lock);
sc->sc_name = sc->sc_provider->name;
mtx_unlock(&g_gate_units_lock);
+   G_GATE_DEBUG(1, "Device %s created.", gp->name);
 
if (sc->sc_timeout > 0) {
callout_reset(&sc->sc_callout, sc->sc_timeout * hz,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220174 - in vendor/NetBSD/libedit: . dist dist/TEST

2011-03-30 Thread David E. O'Brien
Author: obrien
Date: Thu Mar 31 00:46:27 2011
New Revision: 220174
URL: http://svn.freebsd.org/changeset/base/220174

Log:
  Vendor import NetBSD's libedit of "1997-06-25 01:14:45 -0700".
  
  Obtained from:NetBSD

Added:
  vendor/NetBSD/libedit/
  vendor/NetBSD/libedit/dist/
  vendor/NetBSD/libedit/dist/Makefile   (contents, props changed)
  vendor/NetBSD/libedit/dist/TEST/
  vendor/NetBSD/libedit/dist/TEST/test.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/chared.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/chared.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/common.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/editline.3   (contents, props changed)
  vendor/NetBSD/libedit/dist/editrc.5   (contents, props changed)
  vendor/NetBSD/libedit/dist/el.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/el.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/emacs.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/hist.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/hist.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/histedit.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/history.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/key.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/key.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/makelist
  vendor/NetBSD/libedit/dist/map.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/map.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/parse.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/parse.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/prompt.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/prompt.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/read.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/refresh.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/refresh.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/search.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/search.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/shlib_version
  vendor/NetBSD/libedit/dist/sig.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/sig.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/sys.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/term.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/term.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/termcap.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/tokenizer.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/tokenizer.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/tty.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/tty.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/vi.c   (contents, props changed)

Added: vendor/NetBSD/libedit/dist/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/NetBSD/libedit/dist/Makefile Thu Mar 31 00:46:27 2011
(r220174)
@@ -0,0 +1,63 @@
+#  $NetBSD: Makefile,v 1.8 1997/05/09 07:50:14 mycroft Exp $
+#  @(#)Makefile8.1 (Berkeley) 6/4/93
+
+LIB=   edit
+
+OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \
+   parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
+
+MAN=   editline.3 editrc.5
+
+MLINKS=editline.3 el_init.3 editline.3 el_end.3 editline.3 el_reset.3 \
+   editline.3 el_gets.3 editline.3 el_getc.3 editline.3 el_push.3 \
+   editline.3 el_parse.3 editline.3 el_set.3 editline.3 el_source.3 \
+   editline.3 el_resize.3 editline.3 el_line.3 \
+   editline.3 el_insertstr.3 editline.3 el_deletestr.3 \
+   editline.3 history_init.3 editline.3 history_end.3 editline.3 history.3
+
+# For speed and debugging
+#SRCS=   ${OSRCS} tokenizer.c history.c
+# For protection
+SRCS=  editline.c tokenizer.c history.c
+
+SRCS+= common.h emacs.h fcns.h help.h vi.h
+
+INCS= histedit.h
+INCSDIR=/usr/include
+
+CLEANFILES+=common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
+CFLAGS+=-I. -I${.CURDIR} 
+CFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
+CFLAGS+=#-DDEBUG_PASTE
+
+AHDR=vi.h emacs.h common.h 
+ASRC=${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c
+
+vi.h: vi.c makelist
+   sh ${.CURDIR}/makelist -h ${.CURDIR}/vi.c > ${.TARGET}
+
+emacs.h: emacs.c makelist
+   sh ${.CURDIR}/makelist -h ${.CURDIR}/emacs.c > ${.TARGET}
+
+common.h: common.c makelist
+   sh ${.CURDIR}/makelist -h ${.CURDIR}/common.c > ${.TARGET}
+
+fcns.h: ${AHDR} makelist
+   sh ${.CURDIR}/makelist -fh ${AHDR} > ${.TARGET}
+
+fcns.c: ${AHDR} fcns.h makelist
+   sh ${.CURDIR}/makelist -fc ${AHDR} > ${.TARGET}
+
+help.c: ${ASRC} makelist 
+   sh ${.CURDIR}/makelist -bc ${ASRC} > ${.TARGET}
+
+help.h: ${ASRC} makelist
+   sh ${.CURDIR}/ma

svn commit: r220175 - vendor/NetBSD/libedit/1997-06-25

2011-03-30 Thread David E. O'Brien
Author: obrien
Date: Thu Mar 31 00:47:16 2011
New Revision: 220175
URL: http://svn.freebsd.org/changeset/base/220175

Log:
  "Tag" the "1997-06-25 01:14:45 -0700" import.

Added:
  vendor/NetBSD/libedit/1997-06-25/
 - copied from r220174, vendor/NetBSD/libedit/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220176 - in vendor/NetBSD/libedit/dist: . TEST readline

2011-03-30 Thread David E. O'Brien
Author: obrien
Date: Thu Mar 31 01:00:31 2011
New Revision: 220176
URL: http://svn.freebsd.org/changeset/base/220176

Log:
  Vendor import NetBSD's libedit of "2001/09/29 17:52:10 UTC".
  
  Obtained from:NetBSD

Added:
  vendor/NetBSD/libedit/dist/read.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/readline/
  vendor/NetBSD/libedit/dist/readline.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/readline/Makefile   (contents, props changed)
  vendor/NetBSD/libedit/dist/readline/readline.h   (contents, props changed)
Deleted:
  vendor/NetBSD/libedit/dist/termcap.h
Modified:
  vendor/NetBSD/libedit/dist/Makefile
  vendor/NetBSD/libedit/dist/TEST/test.c
  vendor/NetBSD/libedit/dist/chared.c
  vendor/NetBSD/libedit/dist/chared.h
  vendor/NetBSD/libedit/dist/common.c
  vendor/NetBSD/libedit/dist/editline.3
  vendor/NetBSD/libedit/dist/editrc.5
  vendor/NetBSD/libedit/dist/el.c
  vendor/NetBSD/libedit/dist/el.h
  vendor/NetBSD/libedit/dist/emacs.c
  vendor/NetBSD/libedit/dist/hist.c
  vendor/NetBSD/libedit/dist/hist.h
  vendor/NetBSD/libedit/dist/histedit.h
  vendor/NetBSD/libedit/dist/history.c
  vendor/NetBSD/libedit/dist/key.c
  vendor/NetBSD/libedit/dist/key.h
  vendor/NetBSD/libedit/dist/makelist
  vendor/NetBSD/libedit/dist/map.c
  vendor/NetBSD/libedit/dist/map.h
  vendor/NetBSD/libedit/dist/parse.c
  vendor/NetBSD/libedit/dist/parse.h
  vendor/NetBSD/libedit/dist/prompt.c
  vendor/NetBSD/libedit/dist/prompt.h
  vendor/NetBSD/libedit/dist/read.c
  vendor/NetBSD/libedit/dist/refresh.c
  vendor/NetBSD/libedit/dist/refresh.h
  vendor/NetBSD/libedit/dist/search.c
  vendor/NetBSD/libedit/dist/search.h
  vendor/NetBSD/libedit/dist/shlib_version
  vendor/NetBSD/libedit/dist/sig.c
  vendor/NetBSD/libedit/dist/sig.h
  vendor/NetBSD/libedit/dist/sys.h
  vendor/NetBSD/libedit/dist/term.c
  vendor/NetBSD/libedit/dist/term.h
  vendor/NetBSD/libedit/dist/tokenizer.c
  vendor/NetBSD/libedit/dist/tokenizer.h
  vendor/NetBSD/libedit/dist/tty.c
  vendor/NetBSD/libedit/dist/tty.h
  vendor/NetBSD/libedit/dist/vi.c

Modified: vendor/NetBSD/libedit/dist/Makefile
==
--- vendor/NetBSD/libedit/dist/Makefile Thu Mar 31 00:47:16 2011
(r220175)
+++ vendor/NetBSD/libedit/dist/Makefile Thu Mar 31 01:00:31 2011
(r220176)
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.8 1997/05/09 07:50:14 mycroft Exp $
+#  $NetBSD: Makefile,v 1.20 2001/01/05 21:15:49 jdolecek Exp $
 #  @(#)Makefile8.1 (Berkeley) 6/4/93
 
 LIB=   edit
@@ -10,54 +10,78 @@ MAN=editline.3 editrc.5
 
 MLINKS=editline.3 el_init.3 editline.3 el_end.3 editline.3 el_reset.3 \
editline.3 el_gets.3 editline.3 el_getc.3 editline.3 el_push.3 \
-   editline.3 el_parse.3 editline.3 el_set.3 editline.3 el_source.3 \
-   editline.3 el_resize.3 editline.3 el_line.3 \
+   editline.3 el_parse.3 editline.3 el_set.3 editline.3 el_get.3 \
+   editline.3 el_source.3 editline.3 el_resize.3 editline.3 el_line.3 \
editline.3 el_insertstr.3 editline.3 el_deletestr.3 \
editline.3 history_init.3 editline.3 history_end.3 editline.3 history.3
 
 # For speed and debugging
-#SRCS=   ${OSRCS} tokenizer.c history.c
+#SRCS=   ${OSRCS} tokenizer.c history.c readline.c
 # For protection
-SRCS=  editline.c tokenizer.c history.c
+SRCS=  editline.c tokenizer.c history.c readline.c
 
 SRCS+= common.h emacs.h fcns.h help.h vi.h
 
+LIBEDITDIR?=${.CURDIR}
+
 INCS= histedit.h
 INCSDIR=/usr/include
 
 CLEANFILES+=common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
-CFLAGS+=-I. -I${.CURDIR} 
-CFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
-CFLAGS+=#-DDEBUG_PASTE
+CLEANFILES+=common.h.tmp editline.c.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp
+CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp
+CPPFLAGS+=-I. -I${LIBEDITDIR} 
+CPPFLAGS+=-I. -I${.CURDIR}
+CPPFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
+CPPFLAGS+=#-DDEBUG_PASTE
 
 AHDR=vi.h emacs.h common.h 
-ASRC=${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c
+ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c
+
+SUBDIR=readline
 
 vi.h: vi.c makelist
-   sh ${.CURDIR}/makelist -h ${.CURDIR}/vi.c > ${.TARGET}
+   sh ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c > ${.TARGET}.tmp && \
+   mv ${.TARGET}.tmp ${.TARGET}
 
 emacs.h: emacs.c makelist
-   sh ${.CURDIR}/makelist -h ${.CURDIR}/emacs.c > ${.TARGET}
+   sh ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/emacs.c > ${.TARGET}.tmp && \
+   mv ${.TARGET}.tmp ${.TARGET}
 
 common.h: common.c makelist
-   sh ${.CURDIR}/makelist -h ${.CURDIR}/common.c > ${.TARGET}
+   sh ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/common.c > ${.TARGET}.tmp && 
\
+   mv ${.TARGET}.tmp ${.TARGET}
 
 fcns.h: ${AHDR} makelist
-   sh ${.CURDIR}/makelist -fh ${AHDR} > ${.TARGET}
+   sh ${LIBEDITDIR}/makelist -fh ${AHDR} > ${.TARGET}.tmp && \

svn commit: r220177 - vendor/NetBSD/libedit/2001-09-29

2011-03-30 Thread David E. O'Brien
Author: obrien
Date: Thu Mar 31 01:03:24 2011
New Revision: 220177
URL: http://svn.freebsd.org/changeset/base/220177

Log:
  "Tag" the "2001/09/29 17:52:10 UTC" import.

Added:
  vendor/NetBSD/libedit/2001-09-29/
 - copied from r220176, vendor/NetBSD/libedit/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220178 - in vendor/NetBSD/libedit/dist: . TEST readline

2011-03-30 Thread David E. O'Brien
Author: obrien
Date: Thu Mar 31 01:13:05 2011
New Revision: 220178
URL: http://svn.freebsd.org/changeset/base/220178

Log:
  Vendor import NetBSD's libedit of "2005/08/02 12:11:14 UTC".
  
  Obtained from:NetBSD

Added:
  vendor/NetBSD/libedit/dist/TEST/Makefile   (contents, props changed)
  vendor/NetBSD/libedit/dist/config.h   (contents, props changed)
  vendor/NetBSD/libedit/dist/filecomplete.c   (contents, props changed)
  vendor/NetBSD/libedit/dist/filecomplete.h   (contents, props changed)
Deleted:
  vendor/NetBSD/libedit/dist/tokenizer.h
Modified:
  vendor/NetBSD/libedit/dist/Makefile
  vendor/NetBSD/libedit/dist/TEST/test.c
  vendor/NetBSD/libedit/dist/chared.c
  vendor/NetBSD/libedit/dist/chared.h
  vendor/NetBSD/libedit/dist/common.c
  vendor/NetBSD/libedit/dist/editline.3
  vendor/NetBSD/libedit/dist/editrc.5
  vendor/NetBSD/libedit/dist/el.c
  vendor/NetBSD/libedit/dist/el.h
  vendor/NetBSD/libedit/dist/emacs.c
  vendor/NetBSD/libedit/dist/hist.c
  vendor/NetBSD/libedit/dist/hist.h
  vendor/NetBSD/libedit/dist/histedit.h
  vendor/NetBSD/libedit/dist/history.c
  vendor/NetBSD/libedit/dist/key.c
  vendor/NetBSD/libedit/dist/key.h
  vendor/NetBSD/libedit/dist/makelist
  vendor/NetBSD/libedit/dist/map.c
  vendor/NetBSD/libedit/dist/map.h
  vendor/NetBSD/libedit/dist/parse.c
  vendor/NetBSD/libedit/dist/parse.h
  vendor/NetBSD/libedit/dist/prompt.c
  vendor/NetBSD/libedit/dist/prompt.h
  vendor/NetBSD/libedit/dist/read.c
  vendor/NetBSD/libedit/dist/read.h
  vendor/NetBSD/libedit/dist/readline.c
  vendor/NetBSD/libedit/dist/readline/Makefile
  vendor/NetBSD/libedit/dist/readline/readline.h
  vendor/NetBSD/libedit/dist/refresh.c
  vendor/NetBSD/libedit/dist/refresh.h
  vendor/NetBSD/libedit/dist/search.c
  vendor/NetBSD/libedit/dist/search.h
  vendor/NetBSD/libedit/dist/shlib_version
  vendor/NetBSD/libedit/dist/sig.c
  vendor/NetBSD/libedit/dist/sig.h
  vendor/NetBSD/libedit/dist/sys.h
  vendor/NetBSD/libedit/dist/term.c
  vendor/NetBSD/libedit/dist/term.h
  vendor/NetBSD/libedit/dist/tokenizer.c
  vendor/NetBSD/libedit/dist/tty.c
  vendor/NetBSD/libedit/dist/tty.h
  vendor/NetBSD/libedit/dist/vi.c

Modified: vendor/NetBSD/libedit/dist/Makefile
==
--- vendor/NetBSD/libedit/dist/Makefile Thu Mar 31 01:03:24 2011
(r220177)
+++ vendor/NetBSD/libedit/dist/Makefile Thu Mar 31 01:13:05 2011
(r220178)
@@ -1,9 +1,15 @@
-#  $NetBSD: Makefile,v 1.20 2001/01/05 21:15:49 jdolecek Exp $
+#  $NetBSD: Makefile,v 1.34 2005/05/28 12:02:53 lukem Exp $
 #  @(#)Makefile8.1 (Berkeley) 6/4/93
 
+USE_SHLIBDIR=  yes
+
+WARNS= 3
 LIB=   edit
 
-OSRCS= chared.c common.c el.c emacs.c fcns.c help.c hist.c key.c map.c \
+LIBDPLIBS= termcap ${.CURDIR}/../libterm
+
+OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c hist.c \
+   key.c map.c \
parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
 
 MAN=   editline.3 editrc.5
@@ -13,75 +19,86 @@ MLINKS= editline.3 el_init.3 editline.3 
editline.3 el_parse.3 editline.3 el_set.3 editline.3 el_get.3 \
editline.3 el_source.3 editline.3 el_resize.3 editline.3 el_line.3 \
editline.3 el_insertstr.3 editline.3 el_deletestr.3 \
-   editline.3 history_init.3 editline.3 history_end.3 editline.3 history.3
+   editline.3 history_init.3 editline.3 history_end.3 \
+   editline.3 history.3 \
+   editline.3 tok_init.3 editline.3 tok_end.3 editline.3 tok_reset.3 \
+   editline.3 tok_line.3 editline.3 tok_str.3
 
 # For speed and debugging
 #SRCS=   ${OSRCS} tokenizer.c history.c readline.c
 # For protection
 SRCS=  editline.c tokenizer.c history.c readline.c
 
-SRCS+= common.h emacs.h fcns.h help.h vi.h
-
 LIBEDITDIR?=${.CURDIR}
 
 INCS= histedit.h
 INCSDIR=/usr/include
 
-CLEANFILES+=common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
+CLEANFILES+=editline.c
 CLEANFILES+=common.h.tmp editline.c.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp
 CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp
+CLEANFILES+=test.o test
 CPPFLAGS+=-I. -I${LIBEDITDIR} 
 CPPFLAGS+=-I. -I${.CURDIR}
 CPPFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
-CPPFLAGS+=#-DDEBUG_PASTE
+CPPFLAGS+=#-DDEBUG_PASTE -DDEBUG_EDIT
 
 AHDR=vi.h emacs.h common.h 
 ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c
 
+DPSRCS+=   ${AHDR} fcns.h help.h fcns.c help.c
+CLEANFILES+=   ${AHDR} fcns.h help.h fcns.c help.c
+
 SUBDIR=readline
 
-vi.h: vi.c makelist
-   sh ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c > ${.TARGET}.tmp && \
+vi.h: vi.c makelist Makefile
+   ${_MKTARGET_CREATE}
+   ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \
+   > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
 
-emacs.h: emacs.c makelist
-   sh ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/emacs.c > ${.TARGET}.tmp && \
+emacs.h: emacs.c makelist Makefile
+   ${_MKTARGET_CRE

svn commit: r220179 - in vendor/NetBSD/libedit/2005-08-02: . TEST readline

2011-03-30 Thread David E. O'Brien
Author: obrien
Date: Thu Mar 31 01:14:06 2011
New Revision: 220179
URL: http://svn.freebsd.org/changeset/base/220179

Log:
  "Tag" the "2005/08/02 12:11:14 UTC" import.

Added:
  vendor/NetBSD/libedit/2005-08-02/
 - copied from r220176, vendor/NetBSD/libedit/dist/
  vendor/NetBSD/libedit/2005-08-02/TEST/Makefile
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/TEST/Makefile
  vendor/NetBSD/libedit/2005-08-02/config.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/config.h
  vendor/NetBSD/libedit/2005-08-02/filecomplete.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/filecomplete.c
  vendor/NetBSD/libedit/2005-08-02/filecomplete.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/filecomplete.h
Replaced:
  vendor/NetBSD/libedit/2005-08-02/Makefile
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/Makefile
  vendor/NetBSD/libedit/2005-08-02/TEST/test.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/TEST/test.c
  vendor/NetBSD/libedit/2005-08-02/chared.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/chared.c
  vendor/NetBSD/libedit/2005-08-02/chared.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/chared.h
  vendor/NetBSD/libedit/2005-08-02/common.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/common.c
  vendor/NetBSD/libedit/2005-08-02/editline.3
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/editline.3
  vendor/NetBSD/libedit/2005-08-02/editrc.5
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/editrc.5
  vendor/NetBSD/libedit/2005-08-02/el.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/el.c
  vendor/NetBSD/libedit/2005-08-02/el.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/el.h
  vendor/NetBSD/libedit/2005-08-02/emacs.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/emacs.c
  vendor/NetBSD/libedit/2005-08-02/hist.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/hist.c
  vendor/NetBSD/libedit/2005-08-02/hist.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/hist.h
  vendor/NetBSD/libedit/2005-08-02/histedit.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/histedit.h
  vendor/NetBSD/libedit/2005-08-02/history.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/history.c
  vendor/NetBSD/libedit/2005-08-02/key.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/key.c
  vendor/NetBSD/libedit/2005-08-02/key.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/key.h
  vendor/NetBSD/libedit/2005-08-02/makelist
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/makelist
  vendor/NetBSD/libedit/2005-08-02/map.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/map.c
  vendor/NetBSD/libedit/2005-08-02/map.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/map.h
  vendor/NetBSD/libedit/2005-08-02/parse.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/parse.c
  vendor/NetBSD/libedit/2005-08-02/parse.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/parse.h
  vendor/NetBSD/libedit/2005-08-02/prompt.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/prompt.c
  vendor/NetBSD/libedit/2005-08-02/prompt.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/prompt.h
  vendor/NetBSD/libedit/2005-08-02/read.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/read.c
  vendor/NetBSD/libedit/2005-08-02/read.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/read.h
  vendor/NetBSD/libedit/2005-08-02/readline.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/readline.c
  vendor/NetBSD/libedit/2005-08-02/readline/Makefile
 - copied unchanged from r220178, 
vendor/NetBSD/libedit/dist/readline/Makefile
  vendor/NetBSD/libedit/2005-08-02/readline/readline.h
 - copied unchanged from r220178, 
vendor/NetBSD/libedit/dist/readline/readline.h
  vendor/NetBSD/libedit/2005-08-02/refresh.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/refresh.c
  vendor/NetBSD/libedit/2005-08-02/refresh.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/refresh.h
  vendor/NetBSD/libedit/2005-08-02/search.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/search.c
  vendor/NetBSD/libedit/2005-08-02/search.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/search.h
  vendor/NetBSD/libedit/2005-08-02/shlib_version
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/shlib_version
  vendor/NetBSD/libedit/2005-08-02/sig.c
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/sig.c
  vendor/NetBSD/libedit/2005-08-02/sig.h
 - copied unchanged from r220178, vendor/NetBSD/libedit/dist/sig.h
  vendor/NetBSD/libedit/2005-08-02/sys.h
 - copied unchanged from r220178, ven

Re: svn commit: r220162 - head/usr.sbin/pc-sysinstall/backend-partmanager

2011-03-30 Thread Garrett Cooper
On Wed, Mar 30, 2011 at 10:37 AM, Josh Paetzel  wrote:
> Author: jpaetzel
> Date: Wed Mar 30 17:37:04 2011
> New Revision: 220162
> URL: http://svn.freebsd.org/changeset/base/220162
>
> Log:
>  Check in two missing files missed in cleanup.
>  Change expr to $(())
>  Switch test from "$?" = "0" to $? -eq 0
>
>  Approved by:  kib (mentor)
>
> Modified:
>  head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh
>  head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh
>
> Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh
> ==
> --- head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh      Wed 
> Mar 30 17:33:52 2011        (r220161)
> +++ head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh      Wed 
> Mar 30 17:37:04 2011        (r220162)
> @@ -85,7 +85,7 @@ fi
>
>  # If this is an empty disk, see if we need to create a new scheme for it
>  gpart show ${DISK} >/dev/null 2>/dev/null
> -if [ "$?" != "0" -a "${SLICENUM}" = "1" ] ; then
> +if [ $? -eq 0 -a "${SLICENUM}" = "1" ] ; then
>  gpart create -s ${TYPE} ${DISK}
>  fi
>
>
> Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh
> ==
> --- head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh      Wed 
> Mar 30 17:33:52 2011        (r220161)
> +++ head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh      Wed 
> Mar 30 17:37:04 2011        (r220162)
> @@ -57,10 +57,10 @@ PARTINDEX=""
>  while
>  z=1
>  do
> -  CHARS=`expr $CHARS - 1`
> +  CHARS=$((CHARS-1))

This can also be done with the null operator:

: $(( CHARS -= 1 ))

it's the way that the LTP project (which I'm still a member of) does
things in order to be 'portable' (non-portable being bash/korn shell
isms for what little it's worth :)..).

>   LAST_CHAR=`echo "${PARTITION}" | cut -c $CHARS`
> -  echo "${LAST_CHAR}" | grep "^[0-9]$" >/dev/null 2>/dev/null
> -  if [ "$?" = "0" ] ; then
> +  echo "${LAST_CHAR}" | grep -q "^[0-9]$" 2>/dev/null
> +  if [ $? -eq 0 ] ; then
>     PARTINDEX="${LAST_CHAR}${PARTINDEX}"
>   else
>     break

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


svn commit: r220180 - head/sys/mips/atheros

2011-03-30 Thread Adrian Chadd
Author: adrian
Date: Thu Mar 31 02:36:22 2011
New Revision: 220180
URL: http://svn.freebsd.org/changeset/base/220180

Log:
  Implement AR724x USB initialisation code.
  
  This (again) still requires an offset for the AR913x/AR724x before USB will
  function.
  
  Submitted by: Luiz Otavio O Souzau 

Modified:
  head/sys/mips/atheros/ar724x_chip.c
  head/sys/mips/atheros/ar724xreg.h

Modified: head/sys/mips/atheros/ar724x_chip.c
==
--- head/sys/mips/atheros/ar724x_chip.c Thu Mar 31 01:14:06 2011
(r220179)
+++ head/sys/mips/atheros/ar724x_chip.c Thu Mar 31 02:36:22 2011
(r220180)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 static void
@@ -151,6 +152,50 @@ ar724x_chip_get_eth_pll(unsigned int mac
 return 0;
 }
 
+static void
+ar724x_chip_init_usb_peripheral(void)
+{
+
+   switch (ar71xx_soc) {
+   case AR71XX_SOC_AR7240:
+
+   ar71xx_device_stop(AR724X_RESET_MODULE_USB_OHCI_DLL |
+   AR724X_RESET_USB_HOST);
+   DELAY(1000);
+
+   ar71xx_device_start(AR724X_RESET_MODULE_USB_OHCI_DLL |
+   AR724X_RESET_USB_HOST);
+   DELAY(1000);
+
+   /*
+* WAR for HW bug. Here it adjusts the duration
+* between two SOFS.
+*/
+   ATH_WRITE_REG(AR71XX_USB_CTRL_FLADJ,
+   (3 << USB_CTRL_FLADJ_A0_SHIFT));
+
+   break;
+
+   case AR71XX_SOC_AR7241:
+   case AR71XX_SOC_AR7242:
+
+   ar71xx_device_start(AR724X_RESET_MODULE_USB_OHCI_DLL);
+   DELAY(100);
+
+   ar71xx_device_start(AR724X_RESET_USB_HOST);
+   DELAY(100);
+
+   ar71xx_device_start(AR724X_RESET_USB_PHY);
+   DELAY(100);
+
+   break;
+
+   default:
+   /* fallthrough */
+   break;
+   }
+}
+
 struct ar71xx_cpu_def ar724x_chip_def = {
 &ar724x_chip_detect_mem_size,
 &ar724x_chip_detect_sys_frequency,
@@ -163,5 +208,5 @@ struct ar71xx_cpu_def ar724x_chip_def = 
 &ar724x_chip_ddr_flush_ge1,
 &ar724x_chip_get_eth_pll,
NULL,   /* ar71xx_chip_irq_flush_ip2 */
-   NULL/* ar71xx_chip_init_usb_peripheral */
+   &ar724x_chip_init_usb_peripheral
 };

Modified: head/sys/mips/atheros/ar724xreg.h
==
--- head/sys/mips/atheros/ar724xreg.h   Thu Mar 31 01:14:06 2011
(r220179)
+++ head/sys/mips/atheros/ar724xreg.h   Thu Mar 31 02:36:22 2011
(r220180)
@@ -51,6 +51,8 @@
 #defineAR724X_DDR_REG_FLUSH_GE1(AR71XX_DDR_CONFIG + 0x80)
 
 #defineAR724X_RESET_REG_RESET_MODULE   AR71XX_RST_BLOCK_BASE + 0x1c
+#defineAR724X_RESET_USB_HOST   (1 << 5)
+#defineAR724X_RESET_USB_PHY(1 << 4)
 #defineAR724X_RESET_MODULE_USB_OHCI_DLL(1 << 3)
 
 /* XXX so USB requires different init code? -adrian */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220181 - svnadmin/conf

2011-03-30 Thread Andriy Gapon
Author: avg
Date: Thu Mar 31 04:49:07 2011
New Revision: 220181
URL: http://svn.freebsd.org/changeset/base/220181

Log:
  New src committer: Artem Belevich 
  
  Artem has been helping in a number of areas including ZFS and DTrace,
  and he is going to expand his coverage for sure.
  
  Approved by:  core

Modified:
  svnadmin/conf/mentors

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Thu Mar 31 02:36:22 2011(r220180)
+++ svnadmin/conf/mentors   Thu Mar 31 04:49:07 2011(r220181)
@@ -13,6 +13,7 @@
 anchie bz
 andreast   nwhitehorn
 andrew imp
+artavg Co-mentor: marcel
 erimlaier  Co-mentor: thompsa
 gabor  delphij
 hselasky   thompsa
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220182 - head/share/misc

2011-03-30 Thread Ganael LAPLANCHE
Author: martymac (ports committer)
Date: Thu Mar 31 06:11:49 2011
New Revision: 220182
URL: http://svn.freebsd.org/changeset/base/220182

Log:
  Add relation to my mentor (ehaupt)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotThu Mar 31 04:49:07 2011
(r220181)
+++ head/share/misc/committers-ports.dotThu Mar 31 06:11:49 2011
(r220182)
@@ -231,6 +231,7 @@ edwin -> linimon
 edwin -> lx
 
 ehaupt -> db
+ehaupt -> martymac
 
 eik -> sem
 eik -> trhodes
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r220183 - stable/8/usr.sbin/tzsetup

2011-03-30 Thread Edwin Groothuis
Author: edwin
Date: Thu Mar 31 06:29:15 2011
New Revision: 220183
URL: http://svn.freebsd.org/changeset/base/220183

Log:
  MFC of 198254, 198255, 198350, 198267, 209190, 208831, 208830, 210243
  
  198254:
  When tzsetup is run as non-root and the "CMOS clock question on
  UTC" is answered as No, it would abort without properly ending the
  dialog session.
  
  198255:
  Make the usage of the default zoneinfo file to install clearer.
  
  198350:
  - Add support for chrooted installs.
  - Add examples to the man-page.
  
  198267:
  Instead of having to know which timezone was picked last time, you
  now can run "tzsetup -r" which will reinstall the last choice. This
  data is recorded in /var/db/zoneinfo.
  
  209190:
  Use literal format strings.  Found by clang.
  
  208831:
  Add comment that this value is unused.
  It is obvious that it isn't used, but both clang and Coverity talk about it.
  
  208830:
  When there is a problem with writing, also bail out.
  
  Found with the clang checker.
  
  210243:
  Fix support for chrooted installs.

Modified:
  stable/8/usr.sbin/tzsetup/tzsetup.8
  stable/8/usr.sbin/tzsetup/tzsetup.c
Directory Properties:
  stable/8/usr.sbin/tzsetup/   (props changed)

Modified: stable/8/usr.sbin/tzsetup/tzsetup.8
==
--- stable/8/usr.sbin/tzsetup/tzsetup.8 Thu Mar 31 06:11:49 2011
(r220182)
+++ stable/8/usr.sbin/tzsetup/tzsetup.8 Thu Mar 31 06:29:15 2011
(r220183)
@@ -31,8 +31,9 @@
 .Nd set local timezone
 .Sh SYNOPSIS
 .Nm
-.Op Fl ns
-.Op Ar default
+.Op Fl nrs
+.Op Fl C Ar chroot directory
+.Op Ar zoneinfo file | zoneinfo name
 .Sh DESCRIPTION
 The
 .Nm
@@ -49,17 +50,26 @@ the hardware clock does not keep
 .Pp
 The following option is available:
 .Bl -tag -offset indent -width Fl
+.It Fl C Ar chroot directory
+Open all files and directories relative to
+.Ar chroot directory .
 .It Fl n
 Do not create or copy files.
+.It Fl r
+Reinstall the zoneinfo file installed last time. The name is obtained from
+.Pa /var/db/zoneinfo .
 .It Fl s 
 Skip the initial question about adjusting the clock if not set to
 .Tn UTC .
 .El
 .Pp
-It is possible to short-circuit the menu system by specifying a
-.Ar default
-on the command line; this is intended mainly for pre-configured
-installation scripts.
+It is possible to short-circuit the menu system by specifying the
+location of a
+.Ar zoneinfo file
+or the name of the
+.Ar zoneinfo name
+on the command line; this is intended mainly for pre-configured installation
+scripts or people who know which zoneinfo they want to install.
 .Sh TIMEZONE DATABASE
 The contents of the timezone database are indexed by
 .Pa /usr/share/zoneinfo/zone.tab .
@@ -93,19 +103,36 @@ historically minded.
 .Sh FILES
 .Bl -tag -width /usr/share/zoneinfo/zone.tab -compact
 .It Pa /etc/localtime
-current time zone file
+current time zone file.
 .It Pa /etc/wall_cmos_clock
 see
 .Xr adjkerntz 8 .
 .It Pa /usr/share/misc/iso3166
 mapping of
 .Tn ISO
-3166 territory codes to names
+3166 territory codes to names.
 .It Pa /usr/share/zoneinfo
-directory for zoneinfo files
+directory for zoneinfo files.
 .It Pa /usr/share/zoneinfo/zone.tab
-mapping of timezone file to country and location
+mapping of timezone file to country and location.
+.It Pa /var/db/zoneinfo
+saved name of the timezone file installed last.
 .El
+.Sh EXAMPLES
+Normal usage, to select the right zoneinfo file via the dialog-based
+user interface:
+.Dl # tzsetup
+Install the file
+.Pa /usr/share/zoneinfo/Australia/Sydney :
+.Dl # tzsetup /usr/share/zoneinfo/Australia/Sydney
+Install the zoneinfo file for Australia/Sydney, assumed to be located
+in
+.Pa /usr/share/zoneinfo :
+.Dl # tzsetup Australia/Sydney
+After a reinstall of the zoneinfo files, you can reinstall the
+latest installed zoneinfo file: (as specified in
+.Pa /var/db/zoneinfo )
+.Dl # tzsetup -r
 .Sh SEE ALSO
 .Xr date 1 ,
 .Xr adjtime 2 ,

Modified: stable/8/usr.sbin/tzsetup/tzsetup.c
==
--- stable/8/usr.sbin/tzsetup/tzsetup.c Thu Mar 31 06:11:49 2011
(r220182)
+++ stable/8/usr.sbin/tzsetup/tzsetup.c Thu Mar 31 06:29:15 2011
(r220183)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -52,9 +53,17 @@ __FBSDID("$FreeBSD$");
 #define_PATH_ISO3166   "/usr/share/misc/iso3166"
 #define_PATH_ZONEINFO  "/usr/share/zoneinfo"
 #define_PATH_LOCALTIME "/etc/localtime"
+#define_PATH_DB"/var/db/zoneinfo"
 #define_PATH_WALL_CMOS_CLOCK   "/etc/wall_cmos_clock"
 
+static charpath_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN],
+   path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], 
+   path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN];
+
 static int reallydoit = 1;
+static int reinstall = 0;
+static int usedialog = 

svn commit: r220184 - head/sys/geom/nop

2011-03-30 Thread Andrey V. Elsukov
Author: ae
Date: Thu Mar 31 06:30:59 2011
New Revision: 220184
URL: http://svn.freebsd.org/changeset/base/220184

Log:
  Remove unneeded checks, g_new_xxx functions can not return NULL.
  
  Reviewed by:  pjd
  MFC after:1 week

Modified:
  head/sys/geom/nop/g_nop.c

Modified: head/sys/geom/nop/g_nop.c
==
--- head/sys/geom/nop/g_nop.c   Thu Mar 31 06:29:15 2011(r220183)
+++ head/sys/geom/nop/g_nop.c   Thu Mar 31 06:30:59 2011(r220184)
@@ -189,10 +189,6 @@ g_nop_create(struct gctl_req *req, struc
}
}
gp = g_new_geomf(mp, name);
-   if (gp == NULL) {
-   gctl_error(req, "Cannot create geom %s.", name);
-   return (ENOMEM);
-   }
sc = g_malloc(sizeof(*sc), M_WAITOK);
sc->sc_offset = offset;
sc->sc_error = ioerror;
@@ -209,20 +205,10 @@ g_nop_create(struct gctl_req *req, struc
gp->dumpconf = g_nop_dumpconf;
 
newpp = g_new_providerf(gp, gp->name);
-   if (newpp == NULL) {
-   gctl_error(req, "Cannot create provider %s.", name);
-   error = ENOMEM;
-   goto fail;
-   }
newpp->mediasize = size;
newpp->sectorsize = secsize;
 
cp = g_new_consumer(gp);
-   if (cp == NULL) {
-   gctl_error(req, "Cannot create consumer for %s.", gp->name);
-   error = ENOMEM;
-   goto fail;
-   }
error = g_attach(cp, pp);
if (error != 0) {
gctl_error(req, "Cannot attach to provider %s.", pp->name);
@@ -233,18 +219,12 @@ g_nop_create(struct gctl_req *req, struc
G_NOP_DEBUG(0, "Device %s created.", gp->name);
return (0);
 fail:
-   if (cp != NULL) {
-   if (cp->provider != NULL)
-   g_detach(cp);
-   g_destroy_consumer(cp);
-   }
-   if (newpp != NULL)
-   g_destroy_provider(newpp);
-   if (gp != NULL) {
-   if (gp->softc != NULL)
-   g_free(gp->softc);
-   g_destroy_geom(gp);
-   }
+   if (cp->provider != NULL)
+   g_detach(cp);
+   g_destroy_consumer(cp);
+   g_destroy_provider(newpp);
+   g_free(gp->softc);
+   g_destroy_geom(gp);
return (error);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"