Re: terminal emulators using /usr/local/share/terminfo and a bug in perl's Term::Cap

2011-10-02 Thread Nicholas Marriott
This seems fine to me, but I'm not a perl guru. Have you talked to
upstream?

Cheers


On Thu, Sep 29, 2011 at 10:49:36AM +0200, David Coppa wrote:
 Hi,
 
 The patch to ncurses nicm@ commited some days ago, exposes a bug
 in perl's cpan/Term-Cap/Cap.pm. So, when you use rxvt-unicode on
 a recent -current, you will hit this bug with pkg_* tools:
 
 # pkg_delete -v xclip
 failed termcap lookup on rxvt-unicode-256color at 
 /usr/libdata/perl5/OpenBSD/ProgressMeter/Term.pm line 125
 
 If you use a terminal emulator that has a terminfo entry but not
 a termcap one (just like x11/rxvt-unicode or x11/st), you should
 fall back to the case where perl uses infocmp to fake up a
 termcap entry from terminfo, but this never happens because the
 logic is flawed.
 
 Here's a diff:
 
 Index: cpan/Term-Cap/Cap.pm
 ===
 RCS file: /cvs/src/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm,v
 retrieving revision 1.1.1.1
 diff -u -p -r1.1.1.1 Cap.pm
 --- cpan/Term-Cap/Cap.pm  24 Sep 2010 14:49:05 -  1.1.1.1
 +++ cpan/Term-Cap/Cap.pm  29 Sep 2011 08:14:46 -
 @@ -273,7 +273,7 @@ sub Tgetent
  
  my @termcap_path = termcap_path();
  
 -unless ( @termcap_path || $entry )
 +if ( !@termcap_path || !$entry )
  {
  
  # last resort--fake up a termcap from terminfo
 
 
 --- 
 cheers,
 David



Re: fix a seg and minor improvements to config(8)

2011-10-02 Thread Nicholas Marriott
Hi

All but the stat bit looks fine. How do you reproduce the problems? It
seems to fail just fine without it.

$ config -f /x
config: cannot read /x: No such file or directory

Also maybe use access(2) instead?


On Wed, Sep 28, 2011 at 02:37:34AM +0100, Edd Barrett wrote:
 Evening,
 
 When using `config -e`:
  * Don't print a NULL pointer if binary loaded is not a kernel.
  * Don't segfault of binary loaded is not a kernel.
  * Report non-existent kernel via a preliminary stat().
  * Make a warning look like the rest.
 
  OK?
 
 Index: exec.c
 ===
 RCS file: /cvs/src/usr.sbin/config/exec.c,v
 retrieving revision 1.7
 diff -u -r1.7 exec.c
 --- exec.c27 Oct 2009 23:59:51 -  1.7
 +++ exec.c28 Sep 2011 01:19:49 -
 @@ -26,6 +26,8 @@
  
  #include err.h
  #include sys/types.h
 +#include sys/stat.h
 +#include fcntl.h
  #include stdio.h
  
  #ifdef AOUT_SUPPORT
 @@ -109,6 +111,11 @@
  void
  loadkernel(char *file)
  {
 + struct stat st;
 +
 + if (stat(file, st) == -1)
 + err(1, cannot stat '%s', file);
 +
   current_exec = -1;
  
  #ifdef AOUT_SUPPORT
 Index: ukc.c
 ===
 RCS file: /cvs/src/usr.sbin/config/ukc.c,v
 retrieving revision 1.16
 diff -u -r1.16 ukc.c
 --- ukc.c 10 Dec 2009 22:07:19 -  1.16
 +++ ukc.c 28 Sep 2011 01:19:49 -
 @@ -114,10 +114,8 @@
   }
   }
  
 - printf(%s, adjust((caddr_t)nl[P_VERSION].n_value));
 -
   if (force == 0  outfile == NULL)
 - printf(warning: no output file specified\n);
 + printf(WARNING no output file specified\n);
  
   if (nl[IA_EXTRALOC].n_type == 0 || nl[I_NEXTRALOC].n_type == 0 ||
   nl[I_UEXTRALOC].n_type == 0 || nl[I_HISTLEN].n_type == 0 ||
 @@ -155,6 +153,8 @@
   process_history(histlen, history);
   }
  
 + printf(%s, adjust((caddr_t)nl[P_VERSION].n_value));
 +
   if (config()) {
   if (force == 0  outfile == NULL) {
   fprintf(stderr, not forced\n);
 @@ -184,7 +184,9 @@
   struct winsize w;
  #endif
  
 - cd = get_cfdata(0); /* get first item */
 + if ((cd = get_cfdata(0)) == NULL)   /* get first item */
 + errx(1, failed to get first cfdata);
 +
   while (cd-cf_attach != 0) {
   maxdev = i;
   totdev = i;
 
 -- 
 Best Regards
 Edd Barrett



carp error message diff

2011-10-02 Thread Stefan Sperling
Sync error strings between v4 and v6 carp code.

ok?

Index: ip_carp.c
===
RCS file: /cvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.190
diff -u -p -r1.190 ip_carp.c
--- ip_carp.c   6 Sep 2011 16:00:22 -   1.190
+++ ip_carp.c   2 Oct 2011 08:50:13 -
@@ -586,8 +586,8 @@ carp_proto_input(struct mbuf *m, ...)
len = iplen + sizeof(*ch);
if (len  m-m_pkthdr.len) {
carpstats.carps_badlen++;
-   CARP_LOG(LOG_INFO, sc, (packet too short %d on %s, 
m-m_pkthdr.len,
-   m-m_pkthdr.rcvif-if_xname));
+   CARP_LOG(LOG_INFO, sc, (packet size %d too small on %s,
+   m-m_pkthdr.len, m-m_pkthdr.rcvif-if_xname));
m_freem(m);
return;
}
@@ -621,7 +621,8 @@ carp6_proto_input(struct mbuf **mp, int 
struct carp_softc *sc = NULL;
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
struct carp_header *ch;
-   u_int len;
+   int len;
+   char *if_xname;
 
carpstats.carps_ipackets6++;
 
@@ -649,11 +650,13 @@ carp6_proto_input(struct mbuf **mp, int 
}
 
/* verify that we have a complete carp packet */
-   len = m-m_len;
+   len = m-m_pkthdr.len;
+   if_xname = m-m_pkthdr.rcvif-if_xname;
IP6_EXTHDR_GET(ch, struct carp_header *, m, *offp, sizeof(*ch));
if (ch == NULL) {
carpstats.carps_badlen++;
-   CARP_LOG(LOG_INFO, sc, (packet size %u too small, len));
+   CARP_LOG(LOG_INFO, sc, (packet size %d too small on %s,
+   len, if_xname)); 
return (IPPROTO_DONE);
}
 
@@ -662,7 +665,7 @@ carp6_proto_input(struct mbuf **mp, int 
m-m_data += *offp;
if (carp_cksum(m, sizeof(*ch))) {
carpstats.carps_badsum++;
-   CARP_LOG(LOG_INFO, sc, (checksum failed, on %s,
+   CARP_LOG(LOG_INFO, sc, (checksum failed on %s,
m-m_pkthdr.rcvif-if_xname));
m_freem(m);
return (IPPROTO_DONE);



gpioiic: allow SDA and SCL pins to be inverted

2011-10-02 Thread Matthieu Herrb
Hi,

the patch below adds a 'flags' locator to gpioiic(4). It allows to swap
the SDA and SCL pins assigment during attach.  The current gpio attach
code did only allow for SDA being the lowest numbered pin.

But for instance on geode (cs5536) SCL is gpio pin 3 and SDA is pin 4. 

This is a joint work with mbalmer@NetBSD.

My initial code used the offset as SDA pin number and mask as the SCL
pin number, but Marc conviced me that this is inconsistent with other
gpio attachments and that adding a  flag to swap the pins is the way
to go and fixed my code to implement the flag.

Opinions? ok?

Index: share/man/man4/gpioiic.4
===
RCS file: /cvs/OpenBSD/src/share/man/man4/gpioiic.4,v
retrieving revision 1.6
diff -u -r1.6 gpioiic.4
--- share/man/man4/gpioiic.424 Nov 2008 15:30:21 -  1.6
+++ share/man/man4/gpioiic.42 Oct 2011 09:15:09 -
@@ -21,7 +21,7 @@
 .Nm gpioiic
 .Nd GPIO I2C controller
 .Sh SYNOPSIS
-.Cd gpioiic* at gpio? offset 0 mask 0x3
+.Cd gpioiic* at gpio? offset 0 mask 0x3 flags 0x0
 .Cd gpioiic* at gpio?
 .Cd iic* at gpioiic?
 .Sh DESCRIPTION
Index: sys/dev/gpio/files.gpio
===
RCS file: /cvs/OpenBSD/src/sys/dev/gpio/files.gpio,v
retrieving revision 1.8
diff -u -r1.8 files.gpio
--- sys/dev/gpio/files.gpio 28 Nov 2008 17:42:43 -  1.8
+++ sys/dev/gpio/files.gpio 2 Oct 2011 09:15:09 -
@@ -1,6 +1,6 @@
 # $OpenBSD: files.gpio,v 1.8 2008/11/28 17:42:43 mbalmer Exp $
 
-define gpio {[offset = -1], [mask = 0]}
+define gpio {[offset = -1], [mask = 0], [flag = 0]}
 
 device gpio: gpio
 attach gpio at gpiobus
Index: sys/dev/gpio/gpio.c
===
RCS file: /cvs/OpenBSD/src/sys/dev/gpio/gpio.c,v
retrieving revision 1.11
diff -u -r1.11 gpio.c
--- sys/dev/gpio/gpio.c 29 Aug 2009 11:04:56 -  1.11
+++ sys/dev/gpio/gpio.c 2 Oct 2011 09:15:09 -
@@ -131,6 +131,7 @@
ga.ga_gpio = aux;
ga.ga_offset = cf-cf_loc[0];
ga.ga_mask = cf-cf_loc[1];
+   ga.ga_flags = cf-cf_loc[2];
 
if (cf-cf_attach-ca_match(parent, cf, ga)  0)
config_attach(parent, cf, ga, gpio_print);
@@ -282,6 +283,24 @@
return (-1);
 }
 
+struct device *
+gpio_attach_device(struct device *dev, struct gpio_attach_args *ga)
+{
+   struct gpio_softc *sc = (struct gpio_softc *)dev;
+   struct gpio_dev *gdev;
+   struct device *dv;
+
+   dv = config_found_sm(dev, ga, gpiobus_print, 
+   gpio_submatch);
+   if (dv == NULL) 
+   return NULL;
+   
+   gdev = malloc(sizeof(struct gpio_dev), M_DEVBUF, M_NOWAIT);
+   gdev-sc_dev = dv;
+   LIST_INSERT_HEAD(sc-sc_devs, gdev, sc_next);
+   return dv;
+}
+
 int
 gpioioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
 {
@@ -406,6 +425,7 @@
ga.ga_dvname = attach-ga_dvname;
ga.ga_offset = attach-ga_offset;
ga.ga_mask = attach-ga_mask;
+   ga.ga_flags = attach-ga_flags;
dv = config_found_sm((struct device *)sc, ga, gpiobus_print,
gpio_submatch);
if (dv != NULL) {
Index: sys/dev/gpio/gpioiic.c
===
RCS file: /cvs/OpenBSD/src/sys/dev/gpio/gpioiic.c,v
retrieving revision 1.8
diff -u -r1.8 gpioiic.c
--- sys/dev/gpio/gpioiic.c  24 Nov 2008 12:12:12 -  1.8
+++ sys/dev/gpio/gpioiic.c  2 Oct 2011 09:15:09 -
@@ -35,6 +35,9 @@
 #define GPIOIIC_PIN_SCL1
 #define GPIOIIC_NPINS  2
 
+/* flags */
+#define GPIOIIC_PIN_REVERSE0x01
+
 #define GPIOIIC_SDA0x01
 #define GPIOIIC_SCL0x02
 
@@ -48,6 +51,9 @@
struct i2c_controller   sc_i2c_tag;
struct rwlock   sc_i2c_lock;
 
+   int sc_pin_sda;
+   int sc_pin_scl;
+
int sc_sda;
int sc_scl;
 };
@@ -120,9 +126,17 @@
printf(: can't map pins\n);
return;
}
+   
+   if (ga-ga_flags  GPIOIIC_PIN_REVERSE) {
+   sc-sc_pin_sda = GPIOIIC_PIN_SCL;
+   sc-sc_pin_scl = GPIOIIC_PIN_SDA;
+   } else {
+   sc-sc_pin_sda = GPIOIIC_PIN_SDA;
+   sc-sc_pin_scl = GPIOIIC_PIN_SCL;
+   }
 
/* Configure SDA pin */
-   caps = gpio_pin_caps(sc-sc_gpio, sc-sc_map, GPIOIIC_PIN_SDA);
+   caps = gpio_pin_caps(sc-sc_gpio, sc-sc_map, sc-sc_pin_sda);
if (!(caps  GPIO_PIN_OUTPUT)) {
printf(: SDA pin is unable to drive output\n);
goto fail;
@@ -131,7 +145,7 @@
printf(: SDA pin is unable to read input\n);
goto fail;
}
-   printf(: SDA[%d], sc-sc_map.pm_map[GPIOIIC_PIN_SDA]);
+   printf(: SDA[%d], 

Re: fix a seg and minor improvements to config(8)

2011-10-02 Thread Edd Barrett
On Sun, Oct 02, 2011 at 07:22:07AM +0100, Nicholas Marriott wrote:
 Hi
 
 All but the stat bit looks fine. How do you reproduce the problems? It
 seems to fail just fine without it.
 
 $ config -f /x
 config: cannot read /x: No such file or directory

To reproduce these, you would use -e.

If you pass a non-existent file:

% config -e /missing_file
config: no supported exec type

If you pass in a non-kernel binary:

% file ~/a
/home/edd/a: ELF 32-bit LSB executable, Intel 80386, version 1, for
OpenBSD, dynamically linked (uses shared libs), not stripped
% config -e ~/a
(null)warning: no output file specified
WARNING this kernel doesn't contain all information needed!
WARNING the commands add and change might not work.
WARNING this kernel doesn't support pseudo devices.
WARNING this kernel doesn't support modification of BUFCACHEPERCENT.
WARNING this kernel doesn't support modification of NKMEMPAGES.
zsh: segmentation fault  config -e ~/a

Cheers

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk



Re: fix a seg and minor improvements to config(8)

2011-10-02 Thread Nicholas Marriott
fine, ok nicm



On Sun, Oct 02, 2011 at 10:46:52AM +0100, Edd Barrett wrote:
 On Sun, Oct 02, 2011 at 07:22:07AM +0100, Nicholas Marriott wrote:
  Hi
  
  All but the stat bit looks fine. How do you reproduce the problems? It
  seems to fail just fine without it.
  
  $ config -f /x
  config: cannot read /x: No such file or directory
 
 To reproduce these, you would use -e.
 
 If you pass a non-existent file:
 
 % config -e /missing_file
 config: no supported exec type
 
 If you pass in a non-kernel binary:
 
 % file ~/a
 /home/edd/a: ELF 32-bit LSB executable, Intel 80386, version 1, for
 OpenBSD, dynamically linked (uses shared libs), not stripped
 % config -e ~/a
 (null)warning: no output file specified
 WARNING this kernel doesn't contain all information needed!
 WARNING the commands add and change might not work.
 WARNING this kernel doesn't support pseudo devices.
 WARNING this kernel doesn't support modification of BUFCACHEPERCENT.
 WARNING this kernel doesn't support modification of NKMEMPAGES.
 zsh: segmentation fault  config -e ~/a
 
 Cheers
 
 -- 
 Best Regards
 Edd Barrett
 
 http://www.theunixzoo.co.uk



carp slaves send IPv6 neighbour advertisements

2011-10-02 Thread Stefan Sperling
After upgrading my carp setup to -current messages like the following
started appearing in the logs of the carp master:

Oct  1 22:09:39 dougal /bsd: nd6_na_input: duplicate IP6 address 
fe80:000a::0200:5eff:fe00:0101
Oct  1 22:09:39 dougal /bsd: nd6_na_input: duplicate IP6 address 
2001:067c:1407:0010::0014

This happens because we now accept neighour advertisements on carp interfaces.
I think we should only send NAs when we're carp master.

Index: nd6_nbr.c
===
RCS file: /cvs/src/sys/netinet6/nd6_nbr.c,v
retrieving revision 1.57
diff -u -p -r1.57 nd6_nbr.c
--- nd6_nbr.c   26 Jul 2011 21:19:51 -  1.57
+++ nd6_nbr.c   2 Oct 2011 11:17:25 -
@@ -869,6 +869,7 @@ nd6_na_output(struct ifnet *ifp, struct 
int icmp6len, maxlen, error;
caddr_t mac;
struct route_in6 ro;
+   struct sockaddr_dl *proxydl = NULL;
 
mac = NULL;
bzero(ro, sizeof(ro));
@@ -989,6 +990,12 @@ nd6_na_output(struct ifnet *ifp, struct 
bcopy(mac, (caddr_t)(nd_opt + 1), ifp-if_addrlen);
} else
flags = ~ND_NA_FLAG_OVERRIDE;
+
+#if NCARP  0
+   /* Do not send NAs for carp addresses if we're not the CARP master. */
+   if (ifp-if_type == IFT_CARP  !carp_iamatch6(ifp, mac, proxydl))
+   goto bad;
+#endif
 
ip6-ip6_plen = htons((u_short)icmp6len);
nd_na-nd_na_flags_reserved = flags;



Re: A few kernel-related questions: UVM, W^X and PAE

2011-10-02 Thread Barbier, Jason
3. What's the point in keeping sys/arch/i386/i386/pmapae.c? Are there any
plans for re-enabling PAE support?

PAE will always be needed for 32bit processors as I understand it. There are
some 32bit processors out there that the
boards will allow for more than 4 gigs of ram But you will need PAE to
actually see it. This used to be a big thing
for SQL servers before everything went 64bit on that side. So why it may not
be enabled by default its a quick option change
to enable it if you ever need it.
That is really the only one I could comment on with out looking like a
complete tard.

On Thu, Sep 29, 2011 at 4:41 PM, Vadim Zhukov persg...@gmail.com wrote:

 Hello all.

 After some talks on opennet.ru I dived into the sys/uvm/ and other
 places, having a few more or less tech-nical questions raised now. Can
 anybody answer them?

 1. amap_share_protect() in sys/uvm/uvm_amap.c is totally unused, is there
 any point for keeping it around?

 2. Am I right that W^X techniques like segment splitting on i386 are not
 used in kernel?

 2a. If yes, what's the main stopper here?

 3. What's the point in keeping sys/arch/i386/i386/pmapae.c? Are there any
 plans for re-enabling PAE support?

 4. Stack gap limit (STACKGAP_RANDOM) on almost all archs is 256*1024
 (some use less). Are there any pitfalls in growing it on (64-bit) archs
 like amd64, changing random bit count from 15 to something more
 effective?

 Thanks in advance, and sorry for bothering, if any.

 --
  WBR,
  Vadim Zhukov

 A: Because it messes up the order in which people normally read text.
 Q: Why is top-posting such a bad thing?
 A: Top-posting.
 Q: What is the most annoying thing in e-mail?




-- 
Defendere vivos a mortuis



Re: fix a seg and minor improvements to config(8)

2011-10-02 Thread Edd Barrett
On Sat, Oct 01, 2011 at 11:10:35PM -0300, Christiano F. Haesbaert wrote:
 
 Makes sense to me, ok.
 
 Later we should fix the include orderning and change the warning
 printfs to stderr. 

Yes. Well, here is the first phase.

 * As haesbaert suggests, correctly order include files.
 * Found some old style function defs. Updated.
 * Found a prototype inside a function. Moved.

 OK?

Index: cmd.c
===
RCS file: /cvs/src/usr.sbin/config/cmd.c,v
retrieving revision 1.18
diff -u -r1.18 cmd.c
--- cmd.c   10 Dec 2009 22:07:19 -  1.18
+++ cmd.c   2 Oct 2011 14:32:27 -
@@ -27,11 +27,13 @@
 #include sys/types.h
 #include sys/device.h
 #include sys/time.h
+
 #include ctype.h
-#include stdio.h
 #include limits.h
 #include nlist.h
+#include stdio.h
 #include string.h
+
 #include misc.h
 #defineCMD_NOEXTERN
 #include cmd.h
Index: exec.c
===
RCS file: /cvs/src/usr.sbin/config/exec.c,v
retrieving revision 1.8
diff -u -r1.8 exec.c
--- exec.c  2 Oct 2011 10:10:30 -   1.8
+++ exec.c  2 Oct 2011 14:32:27 -
@@ -24,9 +24,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include err.h
 #include sys/types.h
 #include sys/stat.h
+
+#include err.h
 #include fcntl.h
 #include stdio.h
 
Index: exec_aout.c
===
RCS file: /cvs/src/usr.sbin/config/exec_aout.c,v
retrieving revision 1.10
diff -u -r1.10 exec_aout.c
--- exec_aout.c 27 Oct 2009 23:59:51 -  1.10
+++ exec_aout.c 2 Oct 2011 14:32:27 -
@@ -24,15 +24,16 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include sys/types.h
+#include sys/exec.h
+
 #include err.h
 #include errno.h
 #include fcntl.h
 #include nlist.h
-#include stdlib.h
 #include stdio.h
+#include stdlib.h
 #include unistd.h
-#include sys/exec.h
-#include sys/types.h
 
 #include config.h
 #include ukc.h
@@ -80,8 +81,7 @@
 
 /* in-memory address - ``kernel'' vaddr */
 caddr_t
-aout_readjust(x)
-   caddr_t x;
+aout_readjust(caddr_t x)
 {
caddr_t y;
 
@@ -99,8 +99,7 @@
 }
 
 int
-aout_check(file)
-   char *file;
+aout_check(char *file)
 {
int fd, ret = 1;
 
Index: exec_ecoff.c
===
RCS file: /cvs/src/usr.sbin/config/exec_ecoff.c,v
retrieving revision 1.10
diff -u -r1.10 exec_ecoff.c
--- exec_ecoff.c27 Oct 2009 23:59:51 -  1.10
+++ exec_ecoff.c2 Oct 2011 14:32:27 -
@@ -24,16 +24,17 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include sys/types.h
+#include sys/exec.h
+#include sys/exec_ecoff.h
+
 #include err.h
 #include errno.h
 #include fcntl.h
 #include nlist.h
-#include stdlib.h
 #include stdio.h
+#include stdlib.h
 #include unistd.h
-#include sys/exec.h
-#include sys/exec_ecoff.h
-#include sys/types.h
 
 #include config.h
 #include ukc.h
Index: exec_elf.c
===
RCS file: /cvs/src/usr.sbin/config/exec_elf.c,v
retrieving revision 1.12
diff -u -r1.12 exec_elf.c
--- exec_elf.c  27 Oct 2009 23:59:51 -  1.12
+++ exec_elf.c  2 Oct 2011 14:32:27 -
@@ -24,16 +24,17 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include sys/types.h
+#include sys/exec.h
+#include sys/exec_elf.h
+
 #include err.h
 #include errno.h
 #include fcntl.h
 #include nlist.h
-#include stdlib.h
 #include stdio.h
+#include stdlib.h
 #include unistd.h
-#include sys/exec.h
-#include sys/exec_elf.h
-#include sys/types.h
 
 #include ukc.h
 #include config.h
Index: files.c
===
RCS file: /cvs/src/usr.sbin/config/files.c,v
retrieving revision 1.17
diff -u -r1.17 files.c
--- files.c 2 Jun 2010 20:42:17 -   1.17
+++ files.c 2 Oct 2011 14:32:27 -
@@ -42,10 +42,12 @@
  */
 
 #include sys/param.h
+
 #include errno.h
 #include stdio.h
 #include stdlib.h
 #include string.h
+
 #include config.h
 
 extern const char *yyfile;
@@ -72,6 +74,10 @@
int (*)(const char *, void *), void *);
 static voidexpr_free(struct nvlist *);
 
+#ifdef DEBUG
+static voidpr0();
+#endif
+
 void
 initfiles(void)
 {
@@ -453,8 +459,6 @@
 void
 prexpr(struct nvlist *expr)
 {
-   static void pr0();
-
printf(expr =);
pr0(expr);
printf(\n);
Index: hash.c
===
RCS file: /cvs/src/usr.sbin/config/hash.c,v
retrieving revision 1.14
diff -u -r1.14 hash.c
--- hash.c  4 Jan 2004 18:30:05 -   1.14
+++ hash.c  2 Oct 2011 14:32:27 -
@@ -42,8 +42,10 @@
  */
 
 #include sys/param.h
+
 #include stdlib.h
 #include string.h
+
 #include config.h
 
 /*
Index: main.c
===

carp ipv6 checksum fix

2011-10-02 Thread Stefan Sperling
I've started seeing the following problem after updating my
carp setup to -current yesterday. But it is probably a bit older.

My carp setup uses IPv6.

The carp master complains as follows:
Oct  1 22:10:19 dougal /bsd: carp: checksum failed, on carp0

The carp slave is also seeing checksum errors, and they cause it to
flip between master and backup states:
Oct  1 22:00:59 cyril /bsd: carp0: state transition: BACKUP - MASTER
Oct  1 22:01:08 cyril /bsd: carp0: state transition: MASTER - BACKUP
Oct  1 22:01:08 cyril /bsd: carp: checksum failed, on carp0
Oct  1 22:01:18 cyril /bsd: carp: checksum failed, on carp0
Oct  1 22:01:38 cyril last message repeated 2 times
Oct  1 22:01:39 cyril /bsd: carp0: state transition: BACKUP - MASTER
Oct  1 22:01:48 cyril /bsd: carp0: state transition: MASTER - BACKUP
Oct  1 22:01:48 cyril /bsd: carp: checksum failed, on carp0
Oct  1 22:01:58 cyril /bsd: carp: checksum failed, on carp0

carp stats on either side look like this:
$ netstat -s -p carp 
carp:
48 packets received (IPv4)
48 packets received (IPv6)
0 packets discarded for bad interface
0 packets discarded for wrong TTL
0 packets shorter than header
   48 discarded for bad checksums
0 discarded packets with a bad version
0 discarded because packet too short
0 discarded for bad authentication
0 discarded for unknown vhid
0 discarded because of a bad address list
0 packets sent (IPv4)
0 packets sent (IPv6)
0 send failed due to mbuf memory error
0 transitions to master

The problem is that the IPv6 input path uses IP6_EXTHDR_GET() to
obtain a pointer to the carp header when verifying the carp header's
checksum. IP6_EXTHDR_GET() internally uses m_pulldown(), which might
return a pointer to a different mbuf in the chain. However, there is
no way for the caller of IP6_EXTHDR_GET() to get at the different mbuf
pointer returned by m_pulldown().

The diff below expands the IP6_EXTHDR_GET() code inline and uses
the different mbuf if it is returned.
Maybe there is a simpler way to write this diff, but it has
the desired effect:

$ netstat -s -p carp 
carp:
94 packets received (IPv4)
94 packets received (IPv6)
0 packets discarded for bad interface
0 packets discarded for wrong TTL
0 packets shorter than header
0 discarded for bad checksums
0 discarded packets with a bad version
0 discarded because packet too short
0 discarded for bad authentication
0 discarded for unknown vhid
0 discarded because of a bad address list
14 packets sent (IPv4)
14 packets sent (IPv6)
0 send failed due to mbuf memory error
1 transition to master

Note that this diff conflicts with the carp error message diff
I sent earlier. However, this diff is about a real bug so I'll wait for
this to get fixed and then adjust my error message diff as necessary.

ok?

Index: ip_carp.c
===
RCS file: /cvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.190
diff -u -p -r1.190 ip_carp.c
--- ip_carp.c   6 Sep 2011 16:00:22 -   1.190
+++ ip_carp.c   2 Oct 2011 14:40:34 -
@@ -622,6 +622,7 @@ carp6_proto_input(struct mbuf **mp, int 
struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
struct carp_header *ch;
u_int len;
+   struct mbuf *m2, *mch;
 
carpstats.carps_ipackets6++;
 
@@ -648,9 +649,22 @@ carp6_proto_input(struct mbuf **mp, int 
return (IPPROTO_DONE);
}
 
-   /* verify that we have a complete carp packet */
-   len = m-m_len;
-   IP6_EXTHDR_GET(ch, struct carp_header *, m, *offp, sizeof(*ch));
+   /* verify that we have a complete carp packet and ensure that
+* the carp header is in a continuous region of memory */
+   len = m-m_pkthdr.len;
+   m2 = NULL;
+   if (m-m_len = (*offp + sizeof(*ch)))
+   ch = (struct carp_header *)(mtod(m, caddr_t) + *offp);
+   else {
+   m2 = m_pulldown(m, *offp, sizeof(*ch), offp);
+   if (m2) {
+   if (m2-m_len  *offp + sizeof(*ch))
+   panic(m_pulldown malfunction);
+   ch = (struct carp_header *)(mtod(m2, caddr_t) + *offp);
+   } else {
+   ch = NULL;
+   }
+   }
if (ch == NULL) {
carpstats.carps_badlen++;
CARP_LOG(LOG_INFO, sc, (packet size %u too small, len));
@@ -659,15 +673,16 @@ carp6_proto_input(struct mbuf **mp, int 
 
 
/* verify the CARP checksum */
-   m-m_data += *offp;
-   if (carp_cksum(m, sizeof(*ch))) {
+   mch = m2 ? m2 : m;
+   mch-m_data += 

routing bug?

2011-10-02 Thread David Coppa
Am I stupid or there's a bug with routing?

This is what I've found when I was trying to switch from the internal
wireless card in my laptop to an external usb wireless adapter...

The system is:

# dmesg | head -n 2
OpenBSD 5.0-current (GENERIC.MP) #2: Fri Sep 30 13:33:44 CEST 2011
dco...@latitude.dacolab.dom:/usr/src/sys/arch/amd64/compile/GENERIC.MP

And ral0 is the mini-pci wireless card in my laptop:

ral0 at pci2 dev 0 function 0 Ralink RT2890 rev 0x00: apic 2 int 17, address 
00:0d:f0:7d:ba:64
ral0: MAC/BBP RT2860 (rev 0x0102), RF RT2820 (MIMO 2T3R)

# ifconfig ral0 nwid homewlan wpa wpakey not displayed up

# dhclient ral0
DHCPREQUEST on ral0 to 255.255.255.255 port 67
DHCPACK from 192.168.2.1 (00:22:6b:e2:e1:61)
bound to 192.168.2.102 -- renewal in 43200 seconds.

# ping -c 5 www.undeadly.org
PING www.undeadly.org (193.109.122.60): 56 data bytes
64 bytes from 193.109.122.60: icmp_seq=0 ttl=244 time=89.307 ms
64 bytes from 193.109.122.60: icmp_seq=1 ttl=244 time=88.787 ms
64 bytes from 193.109.122.60: icmp_seq=2 ttl=244 time=88.743 ms
64 bytes from 193.109.122.60: icmp_seq=3 ttl=244 time=89.016 ms
64 bytes from 193.109.122.60: icmp_seq=4 ttl=244 time=88.311 ms
--- www.undeadly.org ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 88.311/88.832/89.307/0.500 ms

# ifconfig
lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 33152
priority: 0
groups: lo
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff00
bge0: flags=8802BROADCAST,SIMPLEX,MULTICAST mtu 1500
lladdr 00:1c:23:36:a8:89
priority: 0
media: Ethernet autoselect (none)
status: no carrier
enc0: flags=0
priority: 0
groups: enc
status: active
ral0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr 00:0d:f0:7d:ba:64
priority: 4
groups: wlan egress
media: IEEE802.11 autoselect (OFDM54 mode 11g)
status: active
ieee80211: nwid homewlan chan 11 bssid 00:22:6b:e2:e1:62 78dB wpakey 
not displayed wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp
inet6 fe80::20d:f0ff:fe7d:ba64%ral0 prefixlen 64 scopeid 0x5
inet 192.168.2.102 netmask 0xff00 broadcast 192.168.2.255
pflog0: flags=141UP,RUNNING,PROMISC mtu 33152
priority: 0
groups: pflog

# netstat -nrf inet
Routing tables

Internet:
DestinationGatewayFlags   Refs  Use   Mtu  Prio Iface
default192.168.2.1UGS0   12 -12 ral0 
127/8  127.0.0.1  UGRS   00 33152 8 lo0  
127.0.0.1  127.0.0.1  UH 2   34 33152 4 lo0  
192.168.2/24   link#5 UC 10 - 4 ral0 
192.168.2.100:22:6b:e2:e1:61  UHLc   1   10 - 4 ral0 
192.168.2.102  127.0.0.1  UGHS   00 33152 8 lo0  
224/4  link#5 UCS00 -12 ral0 

Ok?

Now I bring the interface down:

# ifconfig ral0 down

# ifconfig ral0 -bssid -chan media autoselect nwid  -nwkey -wpa -wpakey

# route -n flush
default  192.168.2.1  done
127/0127.0.0.1done
192.168.2.1  00:22:6b:e2:e1:61done
192.168.2.102127.0.0.1done
::/128   ::1  done
::/128   ::1  done
::127.0.0.0/128  ::1  done
::224.0.0.0/128  ::1  done
::255.0.0.0/128  ::1  done
:::0.0.0.0/128   ::1  done
2002::/128   ::1  done
2002:7f00::/128  ::1  done
2002:e000::/128  ::1  done
2002:ff00::/128  ::1  done
fe80::/128   ::1  done
fe80::1%lo0  link#3   done
fe80::20d:f0ff:fe7d: 00:0d:f0:7d:ba:64done
fec0::/128   ::1  done
ff01::/128   ::1  done
ff02::/128   ::1  done

# route -n delete -net 192.168.2/24 
  
delete net 192.168.2/24

# netstat -nrf inet 
Routing tables

Internet:
DestinationGatewayFlags   Refs  Use   Mtu  Prio Iface
127.0.0.1  127.0.0.1  UH 0   34 33152 4 lo0  

...And now I plug a new usb wireless adapter in:

rum0 at uhub1 port 1 Cisco-Linksys Compact Wireless-G USB Adapter rev 
2.00/0.01 addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:18:39:1a:19:a9

Same as before:

# ifconfig rum0 nwid homewlan wpa wpakey not displayed up

# dhclient rum0
DHCPREQUEST on rum0 to 255.255.255.255 port 67
DHCPACK from 192.168.2.1 (00:22:6b:e2:e1:61)
bound to 192.168.2.103 -- renewal 

Re: routing bug?

2011-10-02 Thread Mike Belopuhov
you didn't remove an ip address from ral0 after bringing it down.

On Sun, Oct 2, 2011 at 5:13 PM, David Coppa dco...@gmail.com wrote:
 Am I stupid or there's a bug with routing?

 This is what I've found when I was trying to switch from the internal
 wireless card in my laptop to an external usb wireless adapter...

 The system is:

 # dmesg | head -n 2
 OpenBSD 5.0-current (GENERIC.MP) #2: Fri Sep 30 13:33:44 CEST 2011
dco...@latitude.dacolab.dom:/usr/src/sys/arch/amd64/compile/GENERIC.MP

 And ral0 is the mini-pci wireless card in my laptop:

 ral0 at pci2 dev 0 function 0 Ralink RT2890 rev 0x00: apic 2 int 17,
address 00:0d:f0:7d:ba:64
 ral0: MAC/BBP RT2860 (rev 0x0102), RF RT2820 (MIMO 2T3R)

 # ifconfig ral0 nwid homewlan wpa wpakey not displayed up

 # dhclient ral0
 DHCPREQUEST on ral0 to 255.255.255.255 port 67
 DHCPACK from 192.168.2.1 (00:22:6b:e2:e1:61)
 bound to 192.168.2.102 -- renewal in 43200 seconds.

 # ping -c 5 www.undeadly.org
 PING www.undeadly.org (193.109.122.60): 56 data bytes
 64 bytes from 193.109.122.60: icmp_seq=0 ttl=244 time=89.307 ms
 64 bytes from 193.109.122.60: icmp_seq=1 ttl=244 time=88.787 ms
 64 bytes from 193.109.122.60: icmp_seq=2 ttl=244 time=88.743 ms
 64 bytes from 193.109.122.60: icmp_seq=3 ttl=244 time=89.016 ms
 64 bytes from 193.109.122.60: icmp_seq=4 ttl=244 time=88.311 ms
 --- www.undeadly.org ping statistics ---
 5 packets transmitted, 5 packets received, 0.0% packet loss
 round-trip min/avg/max/std-dev = 88.311/88.832/89.307/0.500 ms

 # ifconfig
 lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 33152
priority: 0
groups: lo
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff00
 bge0: flags=8802BROADCAST,SIMPLEX,MULTICAST mtu 1500
lladdr 00:1c:23:36:a8:89
priority: 0
media: Ethernet autoselect (none)
status: no carrier
 enc0: flags=0
priority: 0
groups: enc
status: active
 ral0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr 00:0d:f0:7d:ba:64
priority: 4
groups: wlan egress
media: IEEE802.11 autoselect (OFDM54 mode 11g)
status: active
ieee80211: nwid homewlan chan 11 bssid 00:22:6b:e2:e1:62 78dB wpakey
not displayed wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher
ccmp
inet6 fe80::20d:f0ff:fe7d:ba64%ral0 prefixlen 64 scopeid 0x5
inet 192.168.2.102 netmask 0xff00 broadcast 192.168.2.255
 pflog0: flags=141UP,RUNNING,PROMISC mtu 33152
priority: 0
groups: pflog

 # netstat -nrf inet
 Routing tables

 Internet:
 DestinationGatewayFlags   Refs  Use   Mtu  Prio
Iface
 default192.168.2.1UGS0   12 -12
ral0
 127/8  127.0.0.1  UGRS   00 33152 8 lo0
 127.0.0.1  127.0.0.1  UH 2   34 33152 4 lo0
 192.168.2/24   link#5 UC 10 - 4
ral0
 192.168.2.100:22:6b:e2:e1:61  UHLc   1   10 - 4
ral0
 192.168.2.102  127.0.0.1  UGHS   00 33152 8 lo0
 224/4  link#5 UCS00 -12
ral0

 Ok?

 Now I bring the interface down:

 # ifconfig ral0 down

 # ifconfig ral0 -bssid -chan media autoselect nwid  -nwkey -wpa -wpakey

 # route -n flush
 default  192.168.2.1  done
 127/0127.0.0.1done
 192.168.2.1  00:22:6b:e2:e1:61done
 192.168.2.102127.0.0.1done
 ::/128   ::1  done
 ::/128   ::1  done
 ::127.0.0.0/128  ::1  done
 ::224.0.0.0/128  ::1  done
 ::255.0.0.0/128  ::1  done
 :::0.0.0.0/128   ::1  done
 2002::/128   ::1  done
 2002:7f00::/128  ::1  done
 2002:e000::/128  ::1  done
 2002:ff00::/128  ::1  done
 fe80::/128   ::1  done
 fe80::1%lo0  link#3   done
 fe80::20d:f0ff:fe7d: 00:0d:f0:7d:ba:64done
 fec0::/128   ::1  done
 ff01::/128   ::1  done
 ff02::/128   ::1  done

 # route -n delete -net 192.168.2/24
 delete net 192.168.2/24

 # netstat -nrf inet
 Routing tables

 Internet:
 DestinationGatewayFlags   Refs  Use   Mtu  Prio
Iface
 127.0.0.1  127.0.0.1  UH 0   34 33152 4 lo0

 ...And now I plug a new usb wireless adapter in:

 rum0 at uhub1 port 1 Cisco-Linksys Compact Wireless-G USB Adapter rev
2.00/0.01 addr 2
 rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:18:39:1a:19:a9

 Same as before:

 # ifconfig rum0 nwid homewlan wpa wpakey not displayed up

 # dhclient rum0
 DHCPREQUEST on rum0 to 

Re: routing bug?

2011-10-02 Thread David Coppa
On Sun, Oct 2, 2011 at 5:36 PM, Mike Belopuhov m...@crypt.org.ru wrote:
 you didn't remove an ip address from ral0 after bringing it down.

You're right, this is the right fix. Thanks a lot.

...And I would bet it was because I'm stupid and not because a bug in
OpenBSD :) :)

Ciao,
David



Re: A few kernel-related questions: UVM, W^X and PAE

2011-10-02 Thread Stuart Henderson
On 2011/10/02 07:38, Barbier, Jason wrote:
 3. What's the point in keeping sys/arch/i386/i386/pmapae.c? Are there any
 plans for re-enabling PAE support?
 
 PAE will always be needed for 32bit processors as I understand it. There are
 some 32bit processors out there that the
 boards will allow for more than 4 gigs of ram But you will need PAE to
 actually see it. This used to be a big thing
 for SQL servers before everything went 64bit on that side. So why it may not
 be enabled by default its a quick option change
 to enable it if you ever need it.

PAE is not used on OpenBSD/i386 and from what I remember likely
never will be, just run amd64 if you want more ram.

So there is probably no point keeping this.



dd(1) support for uppercase size modifiers

2011-10-02 Thread Thomas Pfaff
Simple patch to allow uppercase size modifiers (K, M, and G).  Is there
a reason why not to?  Plus, as a bonus you're less likely to mess up if
you've been naughty and used dd on Linux.

Index: args.c
===
RCS file: /cvs/src/bin/dd/args.c,v
retrieving revision 1.18
diff -u -p -r1.18 args.c
--- args.c  27 Oct 2009 23:59:21 -  1.18
+++ args.c  2 Oct 2011 18:04:34 -
@@ -341,6 +341,7 @@ get_bsz(char *val)
++expr;
break;
case 'k':
+   case 'K':
t = num;
num *= 1024;
if (t  num)
@@ -348,6 +349,7 @@ get_bsz(char *val)
++expr;
break;
case 'm':
+   case 'M':
t = num;
num *= 1048576;
if (t  num)
@@ -411,6 +413,7 @@ get_off(char *val)
++expr;
break;
case 'k':
+   case 'K':
t = num;
num *= 1024;
if (t  num)
@@ -418,6 +421,7 @@ get_off(char *val)
++expr;
break;
case 'm':
+   case 'M':
t = num;
num *= 1048576;
if (t  num)



Re: A few kernel-related questions: UVM, W^X and PAE

2011-10-02 Thread Ted Unangst
On Fri, Sep 30, 2011, Vadim Zhukov wrote:
 Hello all.
 
 After some talks on opennet.ru I dived into the sys/uvm/ and other
 places, having a few more or less tech-nical questions raised now. Can
 anybody answer them?

Very nice.

 1. amap_share_protect() in sys/uvm/uvm_amap.c is totally unused, is there
 any point for keeping it around?

No, there's probably more than a few functions no longer used.  It's
hard to know when you delete the last call to a function.  Diffs welcome.

 2. Am I right that W^X techniques like segment splitting on i386 are not
 used in kernel?

Not presently.

 2a. If yes, what's the main stopper here?

A diff.

 3. What's the point in keeping sys/arch/i386/i386/pmapae.c? Are there any
 plans for re-enabling PAE support?

Someday, if somebody gets it to work, it'd be nice to have.  Some people
may want to keep running i386, but most new CPUs let you use the NX bit
with PAE, so it's helpful even with small amounts of memory.

 4. Stack gap limit (STACKGAP_RANDOM) on almost all archs is 256*1024
 (some use less). Are there any pitfalls in growing it on (64-bit) archs
 like amd64, changing random bit count from 15 to something more
 effective?

I can't think of any reason why 1GB or even more wouldn't work on amd64.
You can try it and see.



fstat.1 - a little typo fix

2011-10-02 Thread David Vasek

Just one missing letter.

Regards,
David

Index: src/usr.bin/fstat/fstat.1
===
RCS file: /cvs/src/usr.bin/fstat/fstat.1,v
retrieving revision 1.46
diff -u -p -r1.46 fstat.1
--- src/usr.bin/fstat/fstat.1   2 May 2011 11:14:11 -   1.46
+++ src/usr.bin/fstat/fstat.1   2 Oct 2011 19:39:02 -
@@ -191,7 +191,7 @@ the same file (via
 the name printed may not be the actual
 name that the process originally used to open that file.
 .It Li XFERS
-Dislays number of total data transfers performed on the file.
+Displays number of total data transfers performed on the file.
 .It Li KBYTES
 Displays total number of Kbytes written and read to the file.
 .El



Re: dd(1) support for uppercase size modifiers

2011-10-02 Thread STeve Andre'

On 10/02/11 14:25, Thomas Pfaff wrote:

Simple patch to allow uppercase size modifiers (K, M, and G).  Is there
a reason why not to?  Plus, as a bonus you're less likely to mess up if
you've been naughty and used dd on Linux.

Index: args.c
===


[snip]

What other commands allow case insensitive options?  I don't
see it as desirable to emulate Linuxisms unless there is a good
reason, myself.

--STeve Andre'



UPDATE: xenocara/xkeyboard-config

2011-10-02 Thread Alexandr Shadchin
Hi,

This update xkeyboard-config to the latest release 2.4.
http://koba.devio.us/distfiles/xkeyboard-config-2.4.diff

Tested on amd64.

Comments ? OK ? 

-- 
Alexandr Shadchin



Re: dd(1) support for uppercase size modifiers

2011-10-02 Thread Thomas Pfaff
On Sun, 02 Oct 2011 14:38:42-0400
STeve Andre' and...@msu.edu wrote:

 On 10/02/11 14:25, Thomas Pfaff wrote:
  Simple patch to allow uppercase size modifiers (K, M, and G).  Is there
  a reason why not to?  Plus, as a bonus you're less likely to mess up if
  you've been naughty and used dd on Linux.
 
 What other commands allow case insensitive options?  I don't
 see it as desirable to emulate Linuxisms unless there is a good
 reason, myself.


Well, the point is not to emulate Linux (because then we'd have to change
the behavior of the lowercase suffixes among other things) but to be able
to use the same suffixes that tools with human-readable output displays,
like df -h, du -h, or ls -hl.  The fdisk and disklabel editors are
case-insensitive.



Re: fix a seg and minor improvements to config(8)

2011-10-02 Thread Nicholas Marriott
don't see any harm in this, ok nicm


On Sun, Oct 02, 2011 at 03:44:52PM +0100, Edd Barrett wrote:
 On Sat, Oct 01, 2011 at 11:10:35PM -0300, Christiano F. Haesbaert wrote:
  
  Makes sense to me, ok.
  
  Later we should fix the include orderning and change the warning
  printfs to stderr. 
 
 Yes. Well, here is the first phase.
 
  * As haesbaert suggests, correctly order include files.
  * Found some old style function defs. Updated.
  * Found a prototype inside a function. Moved.
 
  OK?
 
 Index: cmd.c
 ===
 RCS file: /cvs/src/usr.sbin/config/cmd.c,v
 retrieving revision 1.18
 diff -u -r1.18 cmd.c
 --- cmd.c 10 Dec 2009 22:07:19 -  1.18
 +++ cmd.c 2 Oct 2011 14:32:27 -
 @@ -27,11 +27,13 @@
  #include sys/types.h
  #include sys/device.h
  #include sys/time.h
 +
  #include ctype.h
 -#include stdio.h
  #include limits.h
  #include nlist.h
 +#include stdio.h
  #include string.h
 +
  #include misc.h
  #define  CMD_NOEXTERN
  #include cmd.h
 Index: exec.c
 ===
 RCS file: /cvs/src/usr.sbin/config/exec.c,v
 retrieving revision 1.8
 diff -u -r1.8 exec.c
 --- exec.c2 Oct 2011 10:10:30 -   1.8
 +++ exec.c2 Oct 2011 14:32:27 -
 @@ -24,9 +24,10 @@
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  
 -#include err.h
  #include sys/types.h
  #include sys/stat.h
 +
 +#include err.h
  #include fcntl.h
  #include stdio.h
  
 Index: exec_aout.c
 ===
 RCS file: /cvs/src/usr.sbin/config/exec_aout.c,v
 retrieving revision 1.10
 diff -u -r1.10 exec_aout.c
 --- exec_aout.c   27 Oct 2009 23:59:51 -  1.10
 +++ exec_aout.c   2 Oct 2011 14:32:27 -
 @@ -24,15 +24,16 @@
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  
 +#include sys/types.h
 +#include sys/exec.h
 +
  #include err.h
  #include errno.h
  #include fcntl.h
  #include nlist.h
 -#include stdlib.h
  #include stdio.h
 +#include stdlib.h
  #include unistd.h
 -#include sys/exec.h
 -#include sys/types.h
  
  #include config.h
  #include ukc.h
 @@ -80,8 +81,7 @@
  
  /* in-memory address - ``kernel'' vaddr */
  caddr_t
 -aout_readjust(x)
 - caddr_t x;
 +aout_readjust(caddr_t x)
  {
   caddr_t y;
  
 @@ -99,8 +99,7 @@
  }
  
  int
 -aout_check(file)
 - char *file;
 +aout_check(char *file)
  {
   int fd, ret = 1;
  
 Index: exec_ecoff.c
 ===
 RCS file: /cvs/src/usr.sbin/config/exec_ecoff.c,v
 retrieving revision 1.10
 diff -u -r1.10 exec_ecoff.c
 --- exec_ecoff.c  27 Oct 2009 23:59:51 -  1.10
 +++ exec_ecoff.c  2 Oct 2011 14:32:27 -
 @@ -24,16 +24,17 @@
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  
 +#include sys/types.h
 +#include sys/exec.h
 +#include sys/exec_ecoff.h
 +
  #include err.h
  #include errno.h
  #include fcntl.h
  #include nlist.h
 -#include stdlib.h
  #include stdio.h
 +#include stdlib.h
  #include unistd.h
 -#include sys/exec.h
 -#include sys/exec_ecoff.h
 -#include sys/types.h
  
  #include config.h
  #include ukc.h
 Index: exec_elf.c
 ===
 RCS file: /cvs/src/usr.sbin/config/exec_elf.c,v
 retrieving revision 1.12
 diff -u -r1.12 exec_elf.c
 --- exec_elf.c27 Oct 2009 23:59:51 -  1.12
 +++ exec_elf.c2 Oct 2011 14:32:27 -
 @@ -24,16 +24,17 @@
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  
 +#include sys/types.h
 +#include sys/exec.h
 +#include sys/exec_elf.h
 +
  #include err.h
  #include errno.h
  #include fcntl.h
  #include nlist.h
 -#include stdlib.h
  #include stdio.h
 +#include stdlib.h
  #include unistd.h
 -#include sys/exec.h
 -#include sys/exec_elf.h
 -#include sys/types.h
  
  #include ukc.h
  #include config.h
 Index: files.c
 ===
 RCS file: /cvs/src/usr.sbin/config/files.c,v
 retrieving revision 1.17
 diff -u -r1.17 files.c
 --- files.c   2 Jun 2010 20:42:17 -   1.17
 +++ files.c   2 Oct 2011 14:32:27 -
 @@ -42,10 +42,12 @@
   */
  
  #include sys/param.h
 +
  #include errno.h
  #include stdio.h
  #include stdlib.h
  #include string.h
 +
  #include config.h
  
  extern const char *yyfile;
 @@ -72,6 +74,10 @@
   int (*)(const char *, void *), void *);
  static void  expr_free(struct nvlist *);
  
 +#ifdef DEBUG
 +static void  pr0();
 +#endif
 +
  void
  initfiles(void)
  {
 @@ -453,8 +459,6 @@
  void
  prexpr(struct nvlist *expr)
  {
 - static void pr0();
 -
   printf(expr =);
   pr0(expr);
   printf(\n);
 Index: hash.c
 ===
 RCS file: /cvs/src/usr.sbin/config/hash.c,v
 retrieving revision 1.14
 diff -u -r1.14 hash.c
 

Re: fstat.1 - a little typo fix

2011-10-02 Thread Jason McIntyre
On Sun, Oct 02, 2011 at 09:45:05PM +0200, David Vasek wrote:
 Just one missing letter.
 
 Regards,
 David
 

fixed, thanks.
jmc

 Index: src/usr.bin/fstat/fstat.1
 ===
 RCS file: /cvs/src/usr.bin/fstat/fstat.1,v
 retrieving revision 1.46
 diff -u -p -r1.46 fstat.1
 --- src/usr.bin/fstat/fstat.1 2 May 2011 11:14:11 -   1.46
 +++ src/usr.bin/fstat/fstat.1 2 Oct 2011 19:39:02 -
 @@ -191,7 +191,7 @@ the same file (via
  the name printed may not be the actual
  name that the process originally used to open that file.
  .It Li XFERS
 -Dislays number of total data transfers performed on the file.
 +Displays number of total data transfers performed on the file.
  .It Li KBYTES
  Displays total number of Kbytes written and read to the file.
  .El



查w收

2011-10-02 Thread mail...@tw.mtf.news.yahoo.com
 Your friend e/d:d8e  fg+ g5d= e!!

g5f(ggh(o

od;#oah106v732
oeo kwyya
oeoie72m5
og%(og4r5a7

hg3;d::oe e% ooo5234oooo

oh/7d?ge$g(o

xe65wma

f%wf6
http://tw.myblog.yahoo.com/jw!1K84p1yREQXRDO9YOXH0EfAuoaYkEjm18Q--/article?mid=1

Yahoo!e%f)fe0 d= gfe0.ee3.gf4;f0i+i)c
http://tw.fashion.yahoo.com/
g   f,
f   f   Yahoo!e%f)