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

2010-08-13 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Aug 13 06:39:54 2010
New Revision: 211276
URL: http://svn.freebsd.org/changeset/base/211276

Log:
  - When there is no room for returning the result, nss backend
have to return ERANGE and terminate with NS_RETURN.
  - When gethostbyname_r(3) and the friends end with an error,
set errno to the value nss backend returns, and return errno
value.
  
  PR:   kern/131623
  MFC after:2 weeks

Modified:
  head/lib/libc/net/gethostbydns.c
  head/lib/libc/net/gethostbyht.c
  head/lib/libc/net/gethostbynis.c
  head/lib/libc/net/gethostnamadr.c
  head/lib/libc/net/getnetbydns.c
  head/lib/libc/net/getnetbyht.c
  head/lib/libc/net/getnetbynis.c
  head/lib/libc/net/getnetnamadr.c
  head/lib/libc/net/getproto.c
  head/lib/libc/net/getprotoent.c
  head/lib/libc/net/getprotoname.c

Modified: head/lib/libc/net/gethostbydns.c
==
--- head/lib/libc/net/gethostbydns.cFri Aug 13 06:03:54 2010
(r211275)
+++ head/lib/libc/net/gethostbydns.cFri Aug 13 06:39:54 2010
(r211276)
@@ -536,9 +536,12 @@ _dns_gethostbyname(void *rval, void *cb_
return (NS_NOTFOUND);
}
if (__copy_hostent(he, hptr, buffer, buflen) != 0) {
+   *errnop = errno;
+   RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
*h_errnop = statp-res_h_errno;
-   return (NS_NOTFOUND);
+   return (NS_RETURN);
}
+   RES_SET_H_ERRNO(statp, NETDB_SUCCESS);
*((struct hostent **)rval) = hptr;
return (NS_SUCCESS);
 }
@@ -683,11 +686,13 @@ _dns_gethostbyaddr(void *rval, void *cb_
he.h_addrtype = AF_INET6;
he.h_length = NS_IN6ADDRSZ;
}
-   RES_SET_H_ERRNO(statp, NETDB_SUCCESS);
if (__copy_hostent(he, hptr, buffer, buflen) != 0) {
+   *errnop = errno;
+   RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
*h_errnop = statp-res_h_errno;
-   return (NS_NOTFOUND);
+   return (NS_RETURN);
}
+   RES_SET_H_ERRNO(statp, NETDB_SUCCESS);
*((struct hostent **)rval) = hptr;
return (NS_SUCCESS);
 }

Modified: head/lib/libc/net/gethostbyht.c
==
--- head/lib/libc/net/gethostbyht.c Fri Aug 13 06:03:54 2010
(r211275)
+++ head/lib/libc/net/gethostbyht.c Fri Aug 13 06:39:54 2010
(r211276)
@@ -60,6 +60,7 @@ __FBSDID($FreeBSD$);
 #include netdb.h
 #include stdio.h
 #include ctype.h
+#include errno.h
 #include string.h
 #include stdarg.h
 #include nsswitch.h
@@ -192,8 +193,11 @@ gethostent_r(struct hostent *hptr, char 
}
if (gethostent_p(he, hed, statp-options  RES_USE_INET6, statp) != 0)
return (-1);
-   if (__copy_hostent(he, hptr, buffer, buflen) != 0)
-   return (-1);
+   if (__copy_hostent(he, hptr, buffer, buflen) != 0) {
+   RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
+   *h_errnop = statp-res_h_errno;
+   return ((errno != 0) ? errno : -1);
+   }
*result = hptr;
return (0);
 }
@@ -268,8 +272,10 @@ found:
return (NS_NOTFOUND);
}
if (__copy_hostent(he, hptr, buffer, buflen) != 0) {
+   *errnop = errno;
+   RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
*h_errnop = statp-res_h_errno;
-   return (NS_NOTFOUND);
+   return (NS_RETURN);
}
*((struct hostent **)rval) = hptr;
return (NS_SUCCESS);
@@ -323,8 +329,10 @@ _ht_gethostbyaddr(void *rval, void *cb_d
if (error != 0)
return (NS_NOTFOUND);
if (__copy_hostent(he, hptr, buffer, buflen) != 0) {
+   *errnop = errno;
+   RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
*h_errnop = statp-res_h_errno;
-   return (NS_NOTFOUND);
+   return (NS_RETURN);
}
*((struct hostent **)rval) = hptr;
return (NS_SUCCESS);

Modified: head/lib/libc/net/gethostbynis.c
==
--- head/lib/libc/net/gethostbynis.cFri Aug 13 06:03:54 2010
(r211275)
+++ head/lib/libc/net/gethostbynis.cFri Aug 13 06:39:54 2010
(r211276)
@@ -288,8 +288,10 @@ _nis_gethostbyname(void *rval, void *cb_
return (NS_NOTFOUND);
}
if (__copy_hostent(he, hptr, buffer, buflen) != 0) {
+   *errnop = errno;
+   RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
*h_errnop = statp-res_h_errno;
-   return (NS_NOTFOUND);
+   return (NS_RETURN);
}
*((struct hostent **)rval) = hptr;
return (NS_SUCCESS);
@@ -336,8 +338,10 @@ _nis_gethostbyaddr(void *rval, void *cb_
return (NS_NOTFOUND);
}
  

svn commit: r211277 - stable/6/sbin/ip6fw

2010-08-13 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Aug 13 07:34:41 2010
New Revision: 211277
URL: http://svn.freebsd.org/changeset/base/211277

Log:
  Fix the argument type of fill_icmptypes() on amd64.
  
  PR:   bin/132911
  Submitted by: Yoshitaka AHAREN yaharen__at__gm.dns-lab.jp

Modified:
  stable/6/sbin/ip6fw/ip6fw.c

Modified: stable/6/sbin/ip6fw/ip6fw.c
==
--- stable/6/sbin/ip6fw/ip6fw.c Fri Aug 13 06:39:54 2010(r211276)
+++ stable/6/sbin/ip6fw/ip6fw.c Fri Aug 13 07:34:41 2010(r211277)
@@ -764,7 +764,7 @@ fill_ip6opt(u_char *set, u_char *reset, 
 
 void
 fill_icmptypes(types, vp, fw_flg)
-   u_long *types;
+   unsigned *types;
char **vp;
u_short *fw_flg;
 {
___
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: r211252 - head/usr.sbin/acpi/acpidump

2010-08-13 Thread Bruce Evans

On Fri, 13 Aug 2010, Takanori Watanabe wrote:


Log:
 Fix build on amd64 and ia64.


Why not fix it on all arches?


Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Fri Aug 13 00:21:32 2010
(r211251)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Fri Aug 13 00:45:30 2010
(r211252)
...
@@ -623,7 +622,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp)
{
struct TCPAbody *tcpa;
struct TCPAevent *event;
-   u_int64_t len, paddr;
+   uint64_t len, paddr;
unsigned char *vaddr = NULL;
unsigned char *vend = NULL;

@@ -647,7 +646,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp)
printf(END_COMMENT);
return;
}
-   printf(\tClass %d Base Address 0x%jx Length % PRIu64 \n\n,
+   printf(\tClass %u Base Address 0x%jx Length %ju\n\n,
tcpa-platform_class, paddr, len);

if (len == 0) {


For `len', this used to assume that variables of type u_int64_t can
be printed using PRIu64.  Why the PRIu64 abomination should never be
used, this assumption is valid.

For `len', this now assumes that variables of type uint64_t can be
printed using %ju format.  %ju format is for printing variables of
type uintmax_t, so this assumption is invalid unless uint64_t is the
same as uintmax_t.  This assumption happens to be valid on all supported
arches, although it should not be (e.g., on amd64, uint64_t and uintmax_t
both happen to be u_long, but this is illogical since uintmax_t is
supposed to be the largest unsigned integer type but u_long is logically
shorter than unsigned long long).  Fixing these arches might expose
many printf format errors like the above.

For `paddr', this used to and still invalidly assumes that variables of
type uint64_t can be printed using %ju format.

PRIu64 is lu on both amd64 and ia64, and __uint64_t is u_long on both
amd64 and ia64, so I don't see how the original version failed.  In fact,
it doesn't fail for me.

__uintmax_t is u_long on both amd64 and ia64, so the modified version
should work too, though accidentally, just like the unmodified version
works accidentally for `paddr'.

To expose even more printf format errors like the above, make __uintmax_t
unsigned long long on amd64 and keep it as the illogical u_long on amd64.

Bruce
___
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: r211252 - head/usr.sbin/acpi/acpidump

2010-08-13 Thread Dag-Erling Smørgrav
Takanori Watanabe takaw...@freebsd.org writes:
 @@ -647,7 +646,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp)
   printf(END_COMMENT);
   return;
   }
 - printf(\tClass %d Base Address 0x%jx Length % PRIu64 \n\n,
 + printf(\tClass %u Base Address 0x%jx Length %ju\n\n,
   tcpa-platform_class, paddr, len);
  
   if (len == 0) {

This is still wrong, just a different kind of wrong.  Just because the
compiler doesn't complain doesn't mean it's right.  Did you even read
what John and I wrote?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r211278 - head/usr.sbin/acpi/acpidump

2010-08-13 Thread Takanori Watanabe
Author: takawata
Date: Fri Aug 13 09:58:17 2010
New Revision: 211278
URL: http://svn.freebsd.org/changeset/base/211278

Log:
  use uintmax_t instead of uint64_t.
  
  Pointed out by: des.

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Fri Aug 13 07:34:41 2010
(r211277)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Fri Aug 13 09:58:17 2010
(r211278)
@@ -622,7 +622,7 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp)
 {
struct TCPAbody *tcpa;
struct TCPAevent *event;
-   uint64_t len, paddr;
+   uintmax_t len, paddr;
unsigned char *vaddr = NULL;
unsigned char *vend = NULL;
 
___
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: r211221 - head/usr.sbin/acpi/acpidump

2010-08-13 Thread Bruce Evans

On Thu, 12 Aug 2010, John Baldwin wrote:


Dag-Erling Sm??rgrav wrote:

John Baldwin j...@freebsd.org writes:

Dag-Erling Sm??rgrav d...@des.no writes:


Oops, I replied to the commit mail for the round after this before
noticing this thread.


Slightly better:

printf(\tClass %u Base Address 0x%jx Length %ju\n\n,
  	(unsigned int)tcpa-platform_class, (uintmax_t)paddr, 
(uintmax_t)len);


Ugh, this has many more style bugs:
- `unsigned int' is spelled u_int in KNF, partly to try to avoid the next
  bug
- `platform_class' has type uint16_t.  u_int is larger than that on all
  supported machines, and also on unsupported ones with 16-31 bit u_ints.
  Thus the cast has almost no effect, and has no effect on the result.
  On unsupported machines with exactly 16-bit u_ints, it has no effect.
  On unsupported and supported machines with = 17-bit ints, the arg
  gets promoted to a signed int thanks to C90's promotion botch, but
  the value of the signed int is nonnegative so there is no difference
  here from the result of an unbotched promotion to u_int.
- the second line is too ling, and has been nicely mangled by mailers,
  first by putting a hard newline in it and then by quoting it.


but it would probably be easier to define paddr and len as unsigned long
long instead of the misspelled u_int64_t, and use %llx and %llu.

Depends.  If the table defines a field to be a 64-bit integer, it is
better to use an explicitly-64-bit integer type such as uint64_t
rather than assuming that 'long long' is 64-bit.


Nah, unsigned long long shouldn't exist.


Actually, paddr and len are a memory address and an object size,
respectively, so the logical thing would be to use uintptr_t and size_t
with uintmax_t casts...


vm_offset_t and vm_size_t would be more logical, but maybe they are too
BSD(Mach vm)-specific for acpi, especially outside of the kernel.

Except that physical addresses do not always fit in uintptr_t on i386 (think 
PAE with 36-bit physical addresses and 32-bit uintptr_t, same for the 
length).  If they truly were a size_t you could use %z without a uintmax_t 
cast.


Yes, if paddr really means a physical and not a virtual memory address.
PAE has vm_paddr_t for the former.  vm_paddr_t is 32 bits without PAE and
64 bits with PAE.  Printing it and otherwise using it gives the usual
problem that _no_ typedefed type can be printed or otherwise used with a
hard-coded format or type (other than the typedef), but bugs are more
noticable than usual since the type varies widely within a single arch.

Anyway, almost all typedefed types should be cast to [u]intmax_t for
printing, so that you don't have to know too much about what they are.
We are still very sloppy about this for the smaller types, but have
to be more careful for 64-bit types.  Sloppy printing of the smaller
types will break eventually when int or long expands but the typedefs
don't.

Bruce___
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: r211228 - head/sys/kern

2010-08-13 Thread Bruce Evans

On Thu, 12 Aug 2010, Jung-uk Kim wrote:


On Thursday 12 August 2010 12:37 pm, m...@freebsd.org wrote:

On Thu, Aug 12, 2010 at 9:13 AM, Jung-uk Kim j...@freebsd.org

wrote:

Log:
?Provide description for 'machdep.disable_rtc_set' sysctl.
?Clean up style(9) ?nits. ?Remove a redundant return statement
and an unnecessary variable.


Some mailer mangled the whitespace, so the source code was unreadable and
had syntax errors (hard \xa0's) in it.  The hard \xa0's even got into
the plain text in the log message.


--- 8 SNIP!!! --- 8 ---


While the device_printf() is a single statement, it spans multiple
lines.  It seems in this instance that clarity is preserved better
by using braces even though not required by C.

Quoting style(9):

Space after keywords (if, while, for, return, switch).  No braces
('{' and '}') are used for control statements with zero or only a
single statement unless that statement is more than a single line
in which case they are permitted.

So both styles are accepted, and I would think that changing this
is needless code churn.


The main style bug here is the use of C90 string concatenation to
obfuscate (not very long) messages.  Some of the messages fit on
1 line before device_printf() and syslogd add prefixes to them, but
the literal parts of them are misformatted across 3 lines in the
source code.  I try to keep messages shorted so that they fit in
1 line with normal indentation, or outdent long ones so that they
fit in 1 line with abnormal indentation.


Some times it is very hard to read code when if statements contain
excessive braces and 'else' statements although is permitted by
style(9).  It was one of those cases.  Please note a 'else' block was
also removed from there.


I agree, but don't mind the braces here.

Removing the else block makes the misformatting of a string across 3
lines of source more bogus than before, since after reducing the
indentation its lines are now split too early, and without splitting
too early the ugly split string would fit in only 2 lines.

I noticed 1 other unfixed style bug on a changed line: the SYSCTL_INT()
was split much earlier than necessary (before CTLFLAG*).  Now it is
split as late as possible (after the variable name, which is next after
CTLFLAG*).  But SYSCTL_INT() is conventionally always split after
CTLFLAG* unless this would give a too-long line.

Bruce___
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: r211221 - head/usr.sbin/acpi/acpidump

2010-08-13 Thread Dag-Erling Smørgrav
Bruce Evans b...@optusnet.com.au writes:
 - `platform_class' has type uint16_t.  u_int is larger than that on all
   supported machines, and also on unsupported ones with 16-31 bit u_ints.
   Thus the cast has almost no effect, and has no effect on the result.

you have to cast it to *something*, unless you're willing to assume
blindly that uint16_t == unsigned short (and use %h).

 Anyway, almost all typedefed types should be cast to [u]intmax_t for
 printing, so that you don't have to know too much about what they are.

long or even int is fine in many cases, e.g. uid_t, mode_t

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r211279 - stable/8/sys/dev/usb/quirk

2010-08-13 Thread Konstantin Belousov
Author: kib
Date: Fri Aug 13 11:24:02 2010
New Revision: 211279
URL: http://svn.freebsd.org/changeset/base/211279

Log:
  MFC r210931:
  Disable sync cache for the Transcend Jetflash V90.

Modified:
  stable/8/sys/dev/usb/quirk/usb_quirk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c
==
--- stable/8/sys/dev/usb/quirk/usb_quirk.c  Fri Aug 13 09:58:17 2010
(r211278)
+++ stable/8/sys/dev/usb/quirk/usb_quirk.c  Fri Aug 13 11:24:02 2010
(r211279)
@@ -159,6 +159,8 @@ static struct usb_quirk_entry usb_quirks
USB_QUIRK(ALCOR, AU6390, 0x, 0x, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(ALCOR, UMCR_9361, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN),
+   USB_QUIRK(ALCOR, TRANSCEND, 0x0142, 0x0142, UQ_MSC_FORCE_WIRE_BBB,
+   UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE),
USB_QUIRK(ALCOR, TRANSCEND, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB,
UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN),
USB_QUIRK(APACER, HT202, 0x, 0x, UQ_MSC_NO_TEST_UNIT_READY,
___
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: r211280 - in head/sys: conf mips/conf mips/include mips/mips mips/rmi

2010-08-13 Thread Jayachandran C.
Author: jchandra
Date: Fri Aug 13 12:56:00 2010
New Revision: 211280
URL: http://svn.freebsd.org/changeset/base/211280

Log:
  Rename TARGET_XLR_XLS to CPU_RMI to match other CPU_xxx definitions.
  use CPU_RMI all XLR configurations. Update ident string for N32 and
  N64 kernels.

Modified:
  head/sys/conf/options.mips
  head/sys/mips/conf/XLR
  head/sys/mips/conf/XLR64
  head/sys/mips/conf/XLRN32
  head/sys/mips/include/bus.h
  head/sys/mips/include/intr_machdep.h
  head/sys/mips/mips/exception.S
  head/sys/mips/mips/locore.S
  head/sys/mips/mips/machdep.c
  head/sys/mips/rmi/std.xlr

Modified: head/sys/conf/options.mips
==
--- head/sys/conf/options.mips  Fri Aug 13 11:24:02 2010(r211279)
+++ head/sys/conf/options.mips  Fri Aug 13 12:56:00 2010(r211280)
@@ -35,6 +35,7 @@ CPU_SENTRY5   opt_global.h
 CPU_HAVEFPUopt_global.h
 CPU_SB1opt_global.h
 CPU_CNMIPS opt_global.h
+CPU_RMIopt_global.h
 
 ISA_MIPS1  opt_cputype.h
 ISA_MIPS3  opt_cputype.h
@@ -51,7 +52,6 @@ CFE_ENV_SIZE  opt_global.h
 
 NOFPU  opt_global.h
 TARGET_EMULATORopt_ddb.h
-TARGET_XLR_XLS  opt_global.h
 
 TICK_USE_YAMON_FREQopt_global.h
 TICK_USE_MALTA_RTC opt_global.h

Modified: head/sys/mips/conf/XLR
==
--- head/sys/mips/conf/XLR  Fri Aug 13 11:24:02 2010(r211279)
+++ head/sys/mips/conf/XLR  Fri Aug 13 12:56:00 2010(r211280)
@@ -46,7 +46,7 @@
 # $FreeBSD$
 
 machinemips
-cpuCPU_MIPS4KC
+cpuCPU_RMI
 ident  XLR
 
 makeoptionsMODULES_OVERRIDE=

Modified: head/sys/mips/conf/XLR64
==
--- head/sys/mips/conf/XLR64Fri Aug 13 11:24:02 2010(r211279)
+++ head/sys/mips/conf/XLR64Fri Aug 13 12:56:00 2010(r211280)
@@ -18,8 +18,8 @@
 # $FreeBSD$
 
 machinemips
-cpuCPU_MIPS4KC
-ident  XLR
+cpuCPU_RMI
+ident  XLR64
 
 makeoptionsMODULES_OVERRIDE=
 makeoptions TARGET_BIG_ENDIAN

Modified: head/sys/mips/conf/XLRN32
==
--- head/sys/mips/conf/XLRN32   Fri Aug 13 11:24:02 2010(r211279)
+++ head/sys/mips/conf/XLRN32   Fri Aug 13 12:56:00 2010(r211280)
@@ -18,8 +18,8 @@
 # $FreeBSD$
 
 machinemips
-cpuCPU_MIPS4KC
-ident  XLR
+cpuCPU_RMI
+ident  XLRN32
 
 makeoptionsMODULES_OVERRIDE=
 makeoptions TARGET_BIG_ENDIAN

Modified: head/sys/mips/include/bus.h
==
--- head/sys/mips/include/bus.h Fri Aug 13 11:24:02 2010(r211279)
+++ head/sys/mips/include/bus.h Fri Aug 13 12:56:00 2010(r211280)
@@ -721,7 +721,7 @@ void__bs_c(f,_bs_c_8) (void *t, bus_spa
 DECLARE_BUS_SPACE_PROTOTYPES(generic);
 extern bus_space_tag_t mips_bus_space_generic;
 /* Special bus space for RMI processors */
-#ifdef TARGET_XLR_XLS
+#ifdef CPU_RMI
 extern bus_space_tag_t rmi_bus_space;
 extern bus_space_tag_t rmi_pci_bus_space;
 #endif

Modified: head/sys/mips/include/intr_machdep.h
==
--- head/sys/mips/include/intr_machdep.hFri Aug 13 11:24:02 2010
(r211279)
+++ head/sys/mips/include/intr_machdep.hFri Aug 13 12:56:00 2010
(r211280)
@@ -29,7 +29,7 @@
 #ifndef_MACHINE_INTR_MACHDEP_H_
 #define_MACHINE_INTR_MACHDEP_H_
 
-#ifdef TARGET_XLR_XLS
+#ifdef CPU_RMI
 #define XLR_MAX_INTR 64 
 #else
 #define NHARD_IRQS 6

Modified: head/sys/mips/mips/exception.S
==
--- head/sys/mips/mips/exception.S  Fri Aug 13 11:24:02 2010
(r211279)
+++ head/sys/mips/mips/exception.S  Fri Aug 13 12:56:00 2010
(r211280)
@@ -243,7 +243,7 @@ SlowFault:
and a0, a0, a2  ; \
 mtc0a0, MIPS_COP_0_STATUS   ; \
ITLBNOPFIX
-#elif defined(TARGET_XLR_XLS)
+#elif defined(CPU_RMI)
 #define CLEAR_STATUS \
mfc0a0, MIPS_COP_0_STATUS   ;\
li  a2, (MIPS_SR_KX | MIPS_SR_UX | MIPS_SR_COP_2_BIT) ; \
@@ -485,7 +485,7 @@ NNON_LEAF(MipsUserGenException, CALLFRAM
and t0, a0, ~(MIPS_SR_COP_1_BIT | MIPS_SR_EXL | MIPS3_SR_KSU_MASK | 
MIPS_SR_INT_IE)
 #if defined(CPU_CNMIPS)
or  t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS_SR_PX)
-#elif defined(TARGET_XLR_XLS)  
+#elif defined(CPU_RMI) 
or  t0, t0, (MIPS_SR_KX | MIPS_SR_UX | MIPS_SR_COP_2_BIT)
 #endif 
mtc0t0, MIPS_COP_0_STATUS
@@ -703,7 +703,7 @@ NNON_LEAF(MipsUserIntr, CALLFRAME_SIZ, r
and t0, a0, ~(MIPS_SR_COP_1_BIT | MIPS_SR_EXL | MIPS_SR_INT_IE | 

svn commit: r211281 - head/bin/sh

2010-08-13 Thread Jilles Tjoelker
Author: jilles
Date: Fri Aug 13 13:36:18 2010
New Revision: 211281
URL: http://svn.freebsd.org/changeset/base/211281

Log:
  sh: Fix shadowing of sigset.

Modified:
  head/bin/sh/error.c

Modified: head/bin/sh/error.c
==
--- head/bin/sh/error.c Fri Aug 13 12:56:00 2010(r211280)
+++ head/bin/sh/error.c Fri Aug 13 13:36:18 2010(r211281)
@@ -102,7 +102,7 @@ exraise(int e)
 void
 onint(void)
 {
-   sigset_t sigset;
+   sigset_t sigs;
 
/*
 * The !in_dotrap here is safe.  The only way we can arrive here
@@ -115,8 +115,8 @@ onint(void)
return;
}
intpending = 0;
-   sigemptyset(sigset);
-   sigprocmask(SIG_SETMASK, sigset, NULL);
+   sigemptyset(sigs);
+   sigprocmask(SIG_SETMASK, sigs, NULL);
 
/*
 * This doesn't seem to be needed, since main() emits a newline.
___
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: r211221 - head/usr.sbin/acpi/acpidump

2010-08-13 Thread Bruce Evans

On Fri, 13 Aug 2010, [utf-8] Dag-Erling Sm??rgrav wrote:


Bruce Evans b...@optusnet.com.au writes:

- `platform_class' has type uint16_t.  u_int is larger than that on all
  supported machines, and also on unsupported ones with 16-31 bit u_ints.
  Thus the cast has almost no effect, and has no effect on the result.


you have to cast it to *something*, unless you're willing to assume
blindly that uint16_t == unsigned short (and use %h).


No, all function parameters are converted to *something*, and as I partly
explained above, the default something is always int or u_int, with the
lofical sign error for the int not causing any problems.  Various cases:
- KR compiler, or C90-C99 compiler with no prototype in scope: integer
  parameters are converted to int or  u_int if they are smaller than that
  to start, else they are not converted.
- variadic function for a parameter after `...': same as for KR.
- %h format for printf: makes little or no difference except for bogus
  parameters.  The parameter must end up as int or u_int after the default
  promotion.  The %h causes the parameter to be downcast to short or u_short.
  This is different from taking a short or u_short parameter.  You just
  can't pass a short or a u_short to a variadic function,
Here uint16_t is converted to u_int on machines with 16-bit ints, else it
is converted to int.


Anyway, almost all typedefed types should be cast to [u]intmax_t for
printing, so that you don't have to know too much about what they are.


long or even int is fine in many cases, e.g. uid_t, mode_t


Though it works now, it might break someday.  32-bit ino_t and printing
it with %u should have broken already.

Bruce___
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: r211282 - head/sbin/geom/class/multipath

2010-08-13 Thread Matt Jacob
Author: mjacob
Date: Fri Aug 13 15:17:19 2010
New Revision: 211282
URL: http://svn.freebsd.org/changeset/base/211282

Log:
  Avoid a memory leak.
  
  Submitted by: Dmitry Luhtionov via Alexander Motin
  MFC after:1 week

Modified:
  head/sbin/geom/class/multipath/geom_multipath.c

Modified: head/sbin/geom/class/multipath/geom_multipath.c
==
--- head/sbin/geom/class/multipath/geom_multipath.c Fri Aug 13 13:36:18 
2010(r211281)
+++ head/sbin/geom/class/multipath/geom_multipath.c Fri Aug 13 15:17:19 
2010(r211282)
@@ -149,16 +149,6 @@ mp_label(struct gctl_req *req)
}
 
/*
-* Allocate a sector to write as metadata.
-*/
-   sector = malloc(secsize);
-   if (sector == NULL) {
-   gctl_error(req, unable to allocate metadata buffer);
-   return;
-   }
-   memset(sector, 0, secsize);
-
-   /*
 * Generate metadata.
 */
strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic));
@@ -191,6 +181,16 @@ mp_label(struct gctl_req *req)
}
 
/*
+* Allocate a sector to write as metadata.
+*/
+   sector = malloc(secsize);
+   if (sector == NULL) {
+   gctl_error(req, unable to allocate metadata buffer);
+   return;
+   }
+   memset(sector, 0, secsize);
+
+   /*
 * encode the metadata
 */
multipath_metadata_encode(md, sector);
___
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: r211283 - head/sys/net

2010-08-13 Thread Marko Zec
Author: zec
Date: Fri Aug 13 18:17:32 2010
New Revision: 211283
URL: http://svn.freebsd.org/changeset/base/211283

Log:
  When moving an ethernet ifnet from one vnet to another, destroy the
  associated ng_ether netgraph node in the current vnet, and create a
  new one in the target vnet.
  
  Reviewed by:  julian
  MFC after:3 days

Modified:
  head/sys/net/if.c
  head/sys/net/if_ethersubr.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Fri Aug 13 15:17:19 2010(r211282)
+++ head/sys/net/if.c   Fri Aug 13 18:17:32 2010(r211283)
@@ -956,12 +956,21 @@ if_vmove(struct ifnet *ifp, struct vnet 
 */
IFNET_WLOCK();
ifindex_free_locked(ifp-if_index);
+   IFNET_WUNLOCK();
+
+   /*
+* Perform interface-specific reassignment tasks, if provided by
+* the driver.
+*/
+   if (ifp-if_reassign != NULL)
+   ifp-if_reassign(ifp, new_vnet, NULL);
 
/*
 * Switch to the context of the target vnet.
 */
CURVNET_SET_QUIET(new_vnet);
 
+   IFNET_WLOCK();
if (ifindex_alloc_locked(idx) != 0) {
IFNET_WUNLOCK();
panic(if_index overflow);

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Fri Aug 13 15:17:19 2010(r211282)
+++ head/sys/net/if_ethersubr.c Fri Aug 13 18:17:32 2010(r211283)
@@ -129,6 +129,9 @@ static const u_char etherbroadcastaddr[E
 
 static int ether_resolvemulti(struct ifnet *, struct sockaddr **,
struct sockaddr *);
+#ifdef VIMAGE
+static void ether_reassign(struct ifnet *, struct vnet *, char *);
+#endif
 
 /* XXX: should be in an arp support file, not here */
 MALLOC_DEFINE(M_ARPCOM, arpcom, 802.* interface internals);
@@ -944,6 +947,9 @@ ether_ifattach(struct ifnet *ifp, const 
ifp-if_output = ether_output;
ifp-if_input = ether_input;
ifp-if_resolvemulti = ether_resolvemulti;
+#ifdef VIMAGE
+   ifp-if_reassign = ether_reassign;
+#endif
if (ifp-if_baudrate == 0)
ifp-if_baudrate = IF_Mbps(10); /* just a default */
ifp-if_broadcastaddr = etherbroadcastaddr;
@@ -983,6 +989,25 @@ ether_ifdetach(struct ifnet *ifp)
if_detach(ifp);
 }
 
+#ifdef VIMAGE
+void
+ether_reassign(struct ifnet *ifp, struct vnet *new_vnet, char *unused __unused)
+{
+
+   if (IFP2AC(ifp)-ac_netgraph != NULL) {
+   KASSERT(ng_ether_detach_p != NULL,
+   (ng_ether_detach_p is NULL));
+   (*ng_ether_detach_p)(ifp);
+   }
+
+   if (ng_ether_attach_p != NULL) {
+   CURVNET_SET_QUIET(new_vnet);
+   (*ng_ether_attach_p)(ifp);
+   CURVNET_RESTORE();
+   }
+}
+#endif
+
 SYSCTL_DECL(_net_link);
 SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, Ethernet);
 #if defined(INET) || defined(INET6)
___
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: r211284 - head/sys/kern

2010-08-13 Thread Pawel Jakub Dawidek
Author: pjd
Date: Fri Aug 13 19:20:35 2010
New Revision: 211284
URL: http://svn.freebsd.org/changeset/base/211284

Log:
  Simplify taskqueue_drain() by using proved macros.

Modified:
  head/sys/kern/subr_taskqueue.c

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Fri Aug 13 18:17:32 2010
(r211283)
+++ head/sys/kern/subr_taskqueue.c  Fri Aug 13 19:20:35 2010
(r211284)
@@ -248,23 +248,16 @@ taskqueue_run(struct taskqueue *queue, s
 void
 taskqueue_drain(struct taskqueue *queue, struct task *task)
 {
-   if (queue-tq_spin) {   /* XXX */
-   mtx_lock_spin(queue-tq_mutex);
-   while (task-ta_pending != 0 ||
-   (task-ta_running != NULL  task == *task-ta_running)) {
-   msleep_spin(task, queue-tq_mutex, -, 0);
-   }
-   mtx_unlock_spin(queue-tq_mutex);
-   } else {
+
+   if (!queue-tq_spin)
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);
 
-   mtx_lock(queue-tq_mutex);
-   while (task-ta_pending != 0 ||
-   (task-ta_running != NULL  task == *task-ta_running)) {
-   msleep(task, queue-tq_mutex, PWAIT, -, 0);
-   }
-   mtx_unlock(queue-tq_mutex);
+   TQ_LOCK(queue);
+   while (task-ta_pending != 0 ||
+   (task-ta_running != NULL  task == *task-ta_running)) {
+   TQ_SLEEP(queue, task, queue-tq_mutex, PWAIT, -, 0);
}
+   TQ_UNLOCK(queue);
 }
 
 static void
___
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: r211285 - head/sys/dev/alc

2010-08-13 Thread Pyun YongHyeon
Author: yongari
Date: Fri Aug 13 19:39:33 2010
New Revision: 211285
URL: http://svn.freebsd.org/changeset/base/211285

Log:
  Make sure to disable RX MAC in alc_stop_mac(). Previously there
  was a logic error which it always enabled RX MAC.

Modified:
  head/sys/dev/alc/if_alc.c

Modified: head/sys/dev/alc/if_alc.c
==
--- head/sys/dev/alc/if_alc.c   Fri Aug 13 19:20:35 2010(r211284)
+++ head/sys/dev/alc/if_alc.c   Fri Aug 13 19:39:33 2010(r211285)
@@ -3486,7 +3486,7 @@ alc_stop_mac(struct alc_softc *sc)
/* Disable Rx/Tx MAC. */
reg = CSR_READ_4(sc, ALC_MAC_CFG);
if ((reg  (MAC_CFG_TX_ENB | MAC_CFG_RX_ENB)) != 0) {
-   reg = ~MAC_CFG_TX_ENB | MAC_CFG_RX_ENB;
+   reg = ~(MAC_CFG_TX_ENB | MAC_CFG_RX_ENB);
CSR_WRITE_4(sc, ALC_MAC_CFG, reg);
}
for (i = ALC_TIMEOUT; i  0; i--) {
___
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: r211284 - head/sys/kern

2010-08-13 Thread mdf
On Fri, Aug 13, 2010 at 12:20 PM, Pawel Jakub Dawidek p...@freebsd.org wrote:
 Author: pjd
 Date: Fri Aug 13 19:20:35 2010
 New Revision: 211284
 URL: http://svn.freebsd.org/changeset/base/211284

 Log:
  Simplify taskqueue_drain() by using proved macros.

Thanks!  This was on my to-do list since I'd been in this file, once I
could figure out why it hand't already been done. :-)

Cheers,
matthew



 Modified:
  head/sys/kern/subr_taskqueue.c

 Modified: head/sys/kern/subr_taskqueue.c
 ==
 --- head/sys/kern/subr_taskqueue.c      Fri Aug 13 18:17:32 2010        
 (r211283)
 +++ head/sys/kern/subr_taskqueue.c      Fri Aug 13 19:20:35 2010        
 (r211284)
 @@ -248,23 +248,16 @@ taskqueue_run(struct taskqueue *queue, s
  void
  taskqueue_drain(struct taskqueue *queue, struct task *task)
  {
 -       if (queue-tq_spin) {           /* XXX */
 -               mtx_lock_spin(queue-tq_mutex);
 -               while (task-ta_pending != 0 ||
 -                   (task-ta_running != NULL  task == *task-ta_running)) {
 -                       msleep_spin(task, queue-tq_mutex, -, 0);
 -               }
 -               mtx_unlock_spin(queue-tq_mutex);
 -       } else {
 +
 +       if (!queue-tq_spin)
                WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);

 -               mtx_lock(queue-tq_mutex);
 -               while (task-ta_pending != 0 ||
 -                   (task-ta_running != NULL  task == *task-ta_running)) {
 -                       msleep(task, queue-tq_mutex, PWAIT, -, 0);
 -               }
 -               mtx_unlock(queue-tq_mutex);
 +       TQ_LOCK(queue);
 +       while (task-ta_pending != 0 ||
 +           (task-ta_running != NULL  task == *task-ta_running)) {
 +               TQ_SLEEP(queue, task, queue-tq_mutex, PWAIT, -, 0);
        }
 +       TQ_UNLOCK(queue);
  }

  static void

___
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: r211286 - head/share/man/man4

2010-08-13 Thread Joel Dahl
Author: joel (doc committer)
Date: Fri Aug 13 20:27:40 2010
New Revision: 211286
URL: http://svn.freebsd.org/changeset/base/211286

Log:
  Fix typo.

Modified:
  head/share/man/man4/tpm.4

Modified: head/share/man/man4/tpm.4
==
--- head/share/man/man4/tpm.4   Fri Aug 13 19:39:33 2010(r211285)
+++ head/share/man/man4/tpm.4   Fri Aug 13 20:27:40 2010(r211286)
@@ -35,7 +35,7 @@ In
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for various trusted platfrom modules (TPM) that can
+driver provides support for various trusted platform modules (TPM) that can
 store cryptographic keys. 
 .Pp
 Supported modules:
___
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: r211287 - head/bin/sh

2010-08-13 Thread Jilles Tjoelker
Author: jilles
Date: Fri Aug 13 20:29:43 2010
New Revision: 211287
URL: http://svn.freebsd.org/changeset/base/211287

Log:
  sh: Add a forgotten const.

Modified:
  head/bin/sh/eval.c

Modified: head/bin/sh/eval.c
==
--- head/bin/sh/eval.c  Fri Aug 13 20:27:40 2010(r211286)
+++ head/bin/sh/eval.c  Fri Aug 13 20:29:43 2010(r211287)
@@ -641,7 +641,7 @@ evalcommand(union node *cmd, int flags, 
char *lastarg;
int realstatus;
int do_clearcmdentry;
-   char *path = pathval();
+   const char *path = pathval();
 
/* First expand the arguments. */
TRACE((evalcommand(%p, %d) called\n, (void *)cmd, flags));
___
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: r211288 - head/etc

2010-08-13 Thread Jung-uk Kim
Author: jkim
Date: Fri Aug 13 20:43:19 2010
New Revision: 211288
URL: http://svn.freebsd.org/changeset/base/211288

Log:
  Enforce ACPI timer as the timecounter hardware before we change sleep state
  unless it is the current timer.  When we have resumed successfully, restore
  the previous timecounter hardware if it was changed earlier.  Only the ACPI
  timer is guaranteed to increase monotonically between S-state changes.

Modified:
  head/etc/rc.resume
  head/etc/rc.suspend

Modified: head/etc/rc.resume
==
--- head/etc/rc.resume  Fri Aug 13 20:29:43 2010(r211287)
+++ head/etc/rc.resume  Fri Aug 13 20:43:19 2010(r211288)
@@ -43,6 +43,12 @@ if [ -r /var/run/rc.suspend.pid ]; then
echo 'rc.resume: killed rc.suspend that was still around'
 fi
 
+if [ -r /var/run/rc.suspend.tch ]; then
+   _t=`cat /var/run/rc.suspend.tch`
+   /sbin/sysctl -n kern.timecounter.hardware=$_t  /dev/null 21
+   /bin/rm -f /var/run/rc.suspend.tch
+fi
+
 # Turns on a power supply of a card in the slot inactivated.
 # See also contrib/pccardq.c (only for PAO users).
 # pccardq | awk -F '~' '$5 == inactive \

Modified: head/etc/rc.suspend
==
--- head/etc/rc.suspend Fri Aug 13 20:29:43 2010(r211287)
+++ head/etc/rc.suspend Fri Aug 13 20:43:19 2010(r211288)
@@ -43,6 +43,18 @@ fi
 
 echo $$ 2 /dev/null  /var/run/rc.suspend.pid
 
+_t=`/sbin/sysctl -n kern.timecounter.hardware 2 /dev/null`
+case ${_t#ACPI-} in
+fast|safe)
+   /bin/rm -f /var/run/rc.suspend.tch
+   ;;
+*)
+   ( /sbin/sysctl -n kern.timecounter.hardware=ACPI-fast || \
+   /sbin/sysctl -n kern.timecounter.hardware=ACPI-safe ) \
+/dev/null 21  echo $_t  /var/run/rc.suspend.tch
+   ;;
+esac
+
 # If you have troubles on suspending with PC-CARD modem, try this.
 # See also contrib/pccardq.c (Only for PAO users).
 # pccardq | awk -F '~' '$5 == filled  $4 ~ /uart/ \
___
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: r211290 - head/tools/regression/fstest/tests/chflags

2010-08-13 Thread Pawel Jakub Dawidek
Author: pjd
Date: Fri Aug 13 21:17:59 2010
New Revision: 211290
URL: http://svn.freebsd.org/changeset/base/211290

Log:
  - Use loops to avoid code duplication.
  - More tests.

Modified:
  head/tools/regression/fstest/tests/chflags/07.t
  head/tools/regression/fstest/tests/chflags/08.t
  head/tools/regression/fstest/tests/chflags/09.t

Modified: head/tools/regression/fstest/tests/chflags/07.t
==
--- head/tools/regression/fstest/tests/chflags/07.t Fri Aug 13 21:04:43 
2010(r211289)
+++ head/tools/regression/fstest/tests/chflags/07.t Fri Aug 13 21:17:59 
2010(r211290)
@@ -8,7 +8,7 @@ dir=`dirname $0`
 
 require chflags
 
-echo 1..30
+echo 1..93
 
 n0=`namegen`
 n1=`namegen`
@@ -18,37 +18,33 @@ expect 0 mkdir ${n0} 0755
 cdir=`pwd`
 cd ${n0}
 
-expect 0 create ${n1} 0644
-expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
-expect none stat ${n1} flags
-expect 0 chown ${n1} 65534 65534
-expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
-expect none stat ${n1} flags
-expect 0 unlink ${n1}
-
-expect 0 mkdir ${n1} 0755
-expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
-expect none stat ${n1} flags
-expect 0 chown ${n1} 65534 65534
-expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
-expect none stat ${n1} flags
-expect 0 rmdir ${n1}
-
-expect 0 mkfifo ${n1} 0644
-expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
-expect none stat ${n1} flags
-expect 0 chown ${n1} 65534 65534
-expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
-expect none stat ${n1} flags
-expect 0 unlink ${n1}
-
-expect 0 symlink ${n2} ${n1}
-expect EPERM -u 65534 -g 65534 lchflags ${n1} UF_NODUMP
-expect none lstat ${n1} flags
-expect 0 lchown ${n1} 65534 65534
-expect EPERM -u 65533 -g 65533 lchflags ${n1} UF_NODUMP
-expect none lstat ${n1} flags
-expect 0 unlink ${n1}
+for type in regular dir fifo block char socket symlink; do
+   if [ ${type} != symlink ]; then
+   create_file ${type} ${n1}
+   expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
+   expect none stat ${n1} flags
+   expect 0 chown ${n1} 65534 65534
+   expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
+   expect none stat ${n1} flags
+   if [ ${type} = dir ]; then
+   expect 0 rmdir ${n1}
+   else
+   expect 0 unlink ${n1}
+   fi
+   fi
+
+   create_file ${type} ${n1}
+   expect EPERM -u 65534 -g 65534 lchflags ${n1} UF_NODUMP
+   expect none lstat ${n1} flags
+   expect 0 lchown ${n1} 65534 65534
+   expect EPERM -u 65533 -g 65533 lchflags ${n1} UF_NODUMP
+   expect none lstat ${n1} flags
+   if [ ${type} = dir ]; then
+   expect 0 rmdir ${n1}
+   else
+   expect 0 unlink ${n1}
+   fi
+done
 
 cd ${cdir}
 expect 0 rmdir ${n0}

Modified: head/tools/regression/fstest/tests/chflags/08.t
==
--- head/tools/regression/fstest/tests/chflags/08.t Fri Aug 13 21:04:43 
2010(r211289)
+++ head/tools/regression/fstest/tests/chflags/08.t Fri Aug 13 21:17:59 
2010(r211290)
@@ -8,7 +8,7 @@ dir=`dirname $0`
 
 require chflags
 
-echo 1..78
+echo 1..249
 
 n0=`namegen`
 n1=`namegen`
@@ -18,53 +18,41 @@ expect 0 mkdir ${n0} 0755
 cdir=`pwd`
 cd ${n0}
 
-expect 0 create ${n1} 0644
-expect 0 chown ${n1} 65534 65534
-for flag in SF_IMMUTABLE SF_APPEND SF_NOUNLINK; do
-   expect 0 chflags ${n1} ${flag}
-   expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
-   expect ${flag} stat ${n1} flags
-   expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
-   expect ${flag} stat ${n1} flags
+for type in regular dir fifo block char socket symlink; do
+   if [ ${type} != symlink ]; then
+   create_file ${type} ${n1}
+   expect 0 chown ${n1} 65534 65534
+   for flag in SF_IMMUTABLE SF_APPEND SF_NOUNLINK; do
+   expect 0 chflags ${n1} ${flag}
+   expect EPERM -u 65533 -g 65533 chflags ${n1} UF_NODUMP
+   expect ${flag} stat ${n1} flags
+   expect EPERM -u 65534 -g 65534 chflags ${n1} UF_NODUMP
+   expect ${flag} stat ${n1} flags
+   done
+   expect 0 chflags ${n1} none
+   if [ ${type} = dir ]; then
+   expect 0 rmdir ${n1}
+   else
+   expect 0 unlink ${n1}
+   fi
+   fi
+
+   create_file ${type} ${n1}
+   expect 0 lchown ${n1} 65534 65534
+   for flag in SF_IMMUTABLE SF_APPEND SF_NOUNLINK; do
+   expect 0 lchflags ${n1} ${flag}
+   expect EPERM -u 65533 -g 65533 lchflags ${n1} UF_NODUMP
+   expect ${flag} lstat ${n1} flags
+   expect EPERM 

svn commit: r211291 - head/etc

2010-08-13 Thread Jung-uk Kim
Author: jkim
Date: Fri Aug 13 21:23:13 2010
New Revision: 211291
URL: http://svn.freebsd.org/changeset/base/211291

Log:
  Consistently use full pathnames for external commands.

Modified:
  head/etc/rc.resume
  head/etc/rc.suspend

Modified: head/etc/rc.resume
==
--- head/etc/rc.resume  Fri Aug 13 21:17:59 2010(r211290)
+++ head/etc/rc.resume  Fri Aug 13 21:23:13 2010(r211291)
@@ -39,7 +39,7 @@ state=$2
 
 if [ -r /var/run/rc.suspend.pid ]; then
kill -9 `cat /var/run/rc.suspend.pid`
-   rm -f /var/run/rc.suspend.pid
+   /bin/rm -f /var/run/rc.suspend.pid
echo 'rc.resume: killed rc.suspend that was still around'
 fi
 
@@ -62,7 +62,7 @@ fi
 # the following to signal it to reassociate.
 # /usr/sbin/wpa_cli reassociate
 
-logger -t $subsystem resumed at `date +'%Y%m%d %H:%M:%S'`
-sync  sync  sync
+/usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'`
+/bin/sync  /bin/sync  /bin/sync
 
 exit 0

Modified: head/etc/rc.suspend
==
--- head/etc/rc.suspend Fri Aug 13 21:17:59 2010(r211290)
+++ head/etc/rc.suspend Fri Aug 13 21:23:13 2010(r211291)
@@ -64,11 +64,11 @@ esac
 # suspend and reloading it on resume.  Example:
 # kldunload usb
 
-logger -t $subsystem suspend at `date +'%Y%m%d %H:%M:%S'`
-sync  sync  sync
-sleep 3
+/usr/bin/logger -t $subsystem suspend at `/bin/date +'%Y%m%d %H:%M:%S'`
+/bin/sync  /bin/sync  /bin/sync
+/bin/sleep 3
 
-rm -f /var/run/rc.suspend.pid
+/bin/rm -f /var/run/rc.suspend.pid
 if [ $subsystem = apm ]; then
/usr/sbin/zzz
 else
___
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: r211292 - in head/sys/amd64: acpica amd64

2010-08-13 Thread Jung-uk Kim
Author: jkim
Date: Fri Aug 13 22:08:42 2010
New Revision: 211292
URL: http://svn.freebsd.org/changeset/base/211292

Log:
  Reset switchtime to zero rather than the current CPU ticker (TSC) value.
  It is more appropriate in this context because TSC MSR is reset to zero
  when the CPU is restarted from S3 and above.  Move acpi_resync_clock() back
  to where it was before r211202.  It does not make a difference any more.

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/amd64/amd64/mp_machdep.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Fri Aug 13 21:23:13 2010
(r211291)
+++ head/sys/amd64/acpica/acpi_wakeup.c Fri Aug 13 22:08:42 2010
(r211292)
@@ -278,13 +278,13 @@ acpi_sleep_machdep(struct acpi_softc *sc
for (;;)
ia32_pause();
} else {
-   acpi_resync_clock(sc);
-   PCPU_SET(switchtime, cpu_ticks());
+   PCPU_SET(switchtime, 0);
PCPU_SET(switchticks, ticks);
 #ifdef SMP
if (wakeup_cpus != 0)
acpi_wakeup_cpus(sc, wakeup_cpus);
 #endif
+   acpi_resync_clock(sc);
ret = 0;
}
 

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Fri Aug 13 21:23:13 2010
(r211291)
+++ head/sys/amd64/amd64/mp_machdep.c   Fri Aug 13 22:08:42 2010
(r211292)
@@ -1366,7 +1366,7 @@ cpususpend_handler(void)
wbinvd();
atomic_set_int(stopped_cpus, cpumask);
} else {
-   PCPU_SET(switchtime, cpu_ticks());
+   PCPU_SET(switchtime, 0);
PCPU_SET(switchticks, ticks);
}
 
___
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: r211294 - stable/8/usr.sbin/iostat

2010-08-13 Thread Yar Tikhiy
Author: yar
Date: Sat Aug 14 00:50:26 2010
New Revision: 211294
URL: http://svn.freebsd.org/changeset/base/211294

Log:
  MFC r211001:
   Move the sentences telling the defaults for -c and -w
   to where they belong.  Previously they were misplaced,
   i.e., swapped.

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

Modified: stable/8/usr.sbin/iostat/iostat.8
==
--- stable/8/usr.sbin/iostat/iostat.8   Fri Aug 13 22:39:11 2010
(r211293)
+++ stable/8/usr.sbin/iostat/iostat.8   Sat Aug 14 00:50:26 2010
(r211294)
@@ -100,9 +100,9 @@ The options are as follows:
 Repeat the display
 .Ar count
 times.
-If no
-.Ar wait
-interval is specified, the default is 1 second.
+If no repeat
+.Ar count
+is specified, the default is infinity.
 .It Fl C
 Display CPU statistics.
 This is on by default, unless
@@ -236,9 +236,9 @@ is specified.
 Pause
 .Ar wait
 seconds between each display.
-If no repeat
-.Ar count
-is specified, the default is infinity.
+If no
+.Ar wait
+interval is specified, the default is 1 second.
 .It Fl x
 Show extended disk statistics.
 Each disk is displayed on a line of its own with all available statistics.
___
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