svn commit: r208741 - in user/jmallett/octeon: bin/chio games/pom
lib/libc/gen lib/libgssapi lib/libpmc lib/msun/man
libexec/rbootd share/man/man4 share/man/man9 sys/kern sys/sys
tools/regression/u...
Juli Mallett
jmallett at FreeBSD.org
Wed Jun 2 11:21:36 UTC 2010
Author: jmallett
Date: Wed Jun 2 11:21:35 2010
New Revision: 208741
URL: http://svn.freebsd.org/changeset/base/208741
Log:
Merge from head (loopback toolchain changes.)
Added:
user/jmallett/octeon/tools/regression/usr.bin/jot/regress.rand1.out
- copied unchanged from r208740, head/tools/regression/usr.bin/jot/regress.rand1.out
user/jmallett/octeon/tools/regression/usr.bin/jot/regress.rand2.out
- copied unchanged from r208740, head/tools/regression/usr.bin/jot/regress.rand2.out
user/jmallett/octeon/tools/regression/usr.bin/jot/regress.stutter2.out
- copied unchanged from r208740, head/tools/regression/usr.bin/jot/regress.stutter2.out
Modified:
user/jmallett/octeon/bin/chio/chio.c
user/jmallett/octeon/games/pom/pom.6
user/jmallett/octeon/lib/libc/gen/scandir.3
user/jmallett/octeon/lib/libgssapi/gss_compare_name.3
user/jmallett/octeon/lib/libpmc/pmc.ucf.3
user/jmallett/octeon/lib/msun/man/atan2.3
user/jmallett/octeon/lib/msun/man/remainder.3
user/jmallett/octeon/libexec/rbootd/rbootd.8
user/jmallett/octeon/share/man/man4/acpi.4
user/jmallett/octeon/share/man/man4/mpt.4
user/jmallett/octeon/share/man/man9/make_dev.9
user/jmallett/octeon/sys/kern/posix4_mib.c
user/jmallett/octeon/sys/kern/uipc_sem.c
user/jmallett/octeon/sys/sys/posix4.h
user/jmallett/octeon/tools/regression/usr.bin/jot/regress.sh
user/jmallett/octeon/usr.bin/join/join.1
user/jmallett/octeon/usr.bin/jot/jot.1
user/jmallett/octeon/usr.bin/jot/jot.c
user/jmallett/octeon/usr.bin/newkey/newkey.8
Directory Properties:
user/jmallett/octeon/ (props changed)
Modified: user/jmallett/octeon/bin/chio/chio.c
==============================================================================
--- user/jmallett/octeon/bin/chio/chio.c Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/bin/chio/chio.c Wed Jun 2 11:21:35 2010 (r208741)
@@ -1072,6 +1072,7 @@ find_element(char *voltag, uint16_t *et,
/* Read in the changer slots */
if (cp.cp_nslots > 0) {
+ (void) memset(&cesr, 0, sizeof(cesr));
cesr.cesr_element_type = CHET_ST;
cesr.cesr_element_base = 0;
cesr.cesr_element_count = cp.cp_nslots;
Modified: user/jmallett/octeon/games/pom/pom.6
==============================================================================
--- user/jmallett/octeon/games/pom/pom.6 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/games/pom/pom.6 Wed Jun 2 11:21:35 2010 (r208741)
@@ -34,6 +34,7 @@
.\"
.Dd May 31, 1993
.Dt POM 6
+.Os
.Sh NAME
.Nm pom
.Nd display the phase of the moon
Modified: user/jmallett/octeon/lib/libc/gen/scandir.3
==============================================================================
--- user/jmallett/octeon/lib/libc/gen/scandir.3 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/lib/libc/gen/scandir.3 Wed Jun 2 11:21:35 2010 (r208741)
@@ -40,7 +40,7 @@
.Sh SYNOPSIS
.In dirent.h
.Ft int
-.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpconst struct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst struct dirent **, const struct dirent **\\*(rp"
+.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp" "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp"
.Ft int
.Fn alphasort "const struct dirent **d1" "const struct dirent **d2"
.Sh DESCRIPTION
Modified: user/jmallett/octeon/lib/libgssapi/gss_compare_name.3
==============================================================================
--- user/jmallett/octeon/lib/libgssapi/gss_compare_name.3 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/lib/libgssapi/gss_compare_name.3 Wed Jun 2 11:21:35 2010 (r208741)
@@ -28,7 +28,7 @@
.\"
.\" The following commands are required for all man pages.
.Dd January 26, 2010
-.Dt GSS_COMPARE_NAME PRM
+.Dt GSS_COMPARE_NAME 3 PRM
.Os
.Sh NAME
.Nm gss_compare_name
Modified: user/jmallett/octeon/lib/libpmc/pmc.ucf.3
==============================================================================
--- user/jmallett/octeon/lib/libpmc/pmc.ucf.3 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/lib/libpmc/pmc.ucf.3 Wed Jun 2 11:21:35 2010 (r208741)
@@ -111,5 +111,3 @@ The
library was written by
.An "Joseph Koshy"
.Aq jkoshy at FreeBSD.org .
-
-
Modified: user/jmallett/octeon/lib/msun/man/atan2.3
==============================================================================
--- user/jmallett/octeon/lib/msun/man/atan2.3 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/lib/msun/man/atan2.3 Wed Jun 2 11:21:35 2010 (r208741)
@@ -114,7 +114,7 @@ if
.Ar x
> 0,
.It Ta sign( Ns Ar y Ns )*(\*(Pi -
-.Fn atan "\\*(Bay/x\\*(Ba" ) Ta
+.Fn atan "\*(Bay/x\*(Ba" ) Ta
if
.Ar x
< 0,
@@ -122,7 +122,7 @@ if
.No 0 Ta
if x = y = 0, or
.It Ta
-.Pf sign( Ar y Ns )*\\*(Pi/2 Ta
+.Pf sign( Ar y Ns )*\*(Pi/2 Ta
if
.Ar x
= 0 \(!=
Modified: user/jmallett/octeon/lib/msun/man/remainder.3
==============================================================================
--- user/jmallett/octeon/lib/msun/man/remainder.3 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/lib/msun/man/remainder.3 Wed Jun 2 11:21:35 2010 (r208741)
@@ -76,10 +76,10 @@ is the integer nearest the exact value o
.Fa x Ns / Ns Fa y ;
.Ek
moreover if
-.Pf \\*(Ba Fa n
+.Pf \*(Ba Fa n
\-
.Sm off
-.Fa x No / Fa y No \\*(Ba
+.Fa x No / Fa y No \*(Ba
.Sm on
=
1/2
@@ -89,11 +89,11 @@ is even.
Consequently
the remainder is computed exactly and
.Sm off
-.Pf \\*(Ba Fa r No \\*(Ba
+.Pf \*(Ba Fa r No \*(Ba
.Sm on
\*(Le
.Sm off
-.Pf \\*(Ba Fa y No \\*(Ba/2 .
+.Pf \*(Ba Fa y No \*(Ba/2 .
.Sm on
But attempting to take the remainder when
.Fa y
Modified: user/jmallett/octeon/libexec/rbootd/rbootd.8
==============================================================================
--- user/jmallett/octeon/libexec/rbootd/rbootd.8 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/libexec/rbootd/rbootd.8 Wed Jun 2 11:21:35 2010 (r208741)
@@ -103,14 +103,14 @@ and/or comma characters.
A pound sign causes the remainder of a line to be ignored.
.Pp
Here is a sample configuration file:
-.Bl -column 08:00:09:0:66:ad SYSHPBSD,SYSHPUX
-.It #
-.It "# ethernet addr boot file(s) comments
-.It #
-.It "08:00:09:0:66:ad SYSHPBSD # snake (4.3BSD)
-.It "08:00:09:0:59:5b # vandy (anything)
-.It "8::9:1:C6:75 SYSHPBSD,SYSHPUX # jaguar (either)
-.El
+.Bd -literal
+#
+# ethernet addr boot file(s) comments
+#
+08:00:09:0:66:ad SYSHPBSD # snake (4.3BSD)
+08:00:09:0:59:5b # vandy (anything)
+8::9:1:C6:75 SYSHPBSD,SYSHPUX # jaguar (either)
+.Ed
.Pp
The
.Nm
Modified: user/jmallett/octeon/share/man/man4/acpi.4
==============================================================================
--- user/jmallett/octeon/share/man/man4/acpi.4 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/share/man/man4/acpi.4 Wed Jun 2 11:21:35 2010 (r208741)
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 9, 2010
+.Dd June 2, 2010
.Dt ACPI 4
.Os
.Sh NAME
@@ -599,10 +599,8 @@ The
.Nm
CPU idle power management drive conflicts with the local APIC (LAPIC)
timer.
-Disable APIC mode with
-.Va hint.apic.0.disabled
+Disable the local APIC timer with
+.Va hint.apic.0.clock=0
or do not use the
-.Li C2
-and
.Li C3
-states if APIC mode is enabled.
+and deeper states if the local APIC timer is enabled.
Modified: user/jmallett/octeon/share/man/man4/mpt.4
==============================================================================
--- user/jmallett/octeon/share/man/man4/mpt.4 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/share/man/man4/mpt.4 Wed Jun 2 11:21:35 2010 (r208741)
@@ -183,4 +183,3 @@ by
and
.An Scott Long Aq scottl at FreeBSD.org
have made more substantial improvements.
-.Sh BUGS
Modified: user/jmallett/octeon/share/man/man9/make_dev.9
==============================================================================
--- user/jmallett/octeon/share/man/man9/make_dev.9 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/share/man/man9/make_dev.9 Wed Jun 2 11:21:35 2010 (r208741)
@@ -158,14 +158,14 @@ The
function is equivalent to the call
.Bd -literal -offset indent
make_dev_credf(0, cdevsw, unit, cr, uid, gid, perms, fmt, ...);
-.Ed .
+.Ed
.Pp
The
.Fn make_dev
function call is the same as
.Bd -literal -offset indent
make_dev_credf(0, cdevsw, unit, NULL, uid, gid, perms, fmt, ...);
-.Ed .
+.Ed
.Pp
The
.Fn make_dev_alias
@@ -245,7 +245,7 @@ The
function is the same as
.Bd -literal -offset indent
destroy_dev_sched(cdev, NULL, NULL);
-.Ed .
+.Ed
.Pp
The
.Fn d_close
Modified: user/jmallett/octeon/sys/kern/posix4_mib.c
==============================================================================
--- user/jmallett/octeon/sys/kern/posix4_mib.c Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/sys/kern/posix4_mib.c Wed Jun 2 11:21:35 2010 (r208741)
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
static int facility[CTL_P1003_1B_MAXID - 1];
static int facility_initialized[CTL_P1003_1B_MAXID - 1];
+static int p31b_sysctl_proc(SYSCTL_HANDLER_ARGS);
+
/* OID_AUTO isn't working with sysconf(3). I guess I'd have to
* modify it to do a lookup by name from the index.
* For now I've left it a top-level sysctl.
@@ -55,16 +57,21 @@ static int facility_initialized[CTL_P100
SYSCTL_DECL(_p1003_1b);
#define P1B_SYSCTL(num, name) \
-SYSCTL_INT(_p1003_1b, num, \
- name, CTLFLAG_RD, facility + num - 1, 0, "");
+ SYSCTL_INT(_p1003_1b, num, name, CTLFLAG_RD, facility + num - 1, 0, "");
+#define P1B_SYSCTL_RW(num, name) \
+ SYSCTL_PROC(_p1003_1b, num, name, CTLTYPE_INT | CTLFLAG_RW, NULL, num, \
+ p31b_sysctl_proc, "I", "");
#else
SYSCTL_DECL(_kern_p1003_1b);
#define P1B_SYSCTL(num, name) \
-SYSCTL_INT(_kern_p1003_1b, OID_AUTO, \
- name, CTLFLAG_RD, facility + num - 1, 0, "");
+ SYSCTL_INT(_kern_p1003_1b, OID_AUTO, name, CTLFLAG_RD, \
+ facility + num - 1, 0, "");
+#define P1B_SYSCTL_RW(num, name) \
+ SYSCTL_PROC(_p1003_1b, OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW, NULL, \
+ num, p31b_sysctl_proc, "I", "");
SYSCTL_NODE(_kern, OID_AUTO, p1003_1b, CTLFLAG_RW, 0, "P1003.1B");
#endif
@@ -91,13 +98,28 @@ P1B_SYSCTL(CTL_P1003_1B_DELAYTIMER_MAX,
P1B_SYSCTL(CTL_P1003_1B_MQ_OPEN_MAX, mq_open_max);
P1B_SYSCTL(CTL_P1003_1B_PAGESIZE, pagesize);
P1B_SYSCTL(CTL_P1003_1B_RTSIG_MAX, rtsig_max);
-P1B_SYSCTL(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max);
+P1B_SYSCTL_RW(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max);
P1B_SYSCTL(CTL_P1003_1B_SEM_VALUE_MAX, sem_value_max);
P1B_SYSCTL(CTL_P1003_1B_SIGQUEUE_MAX, sigqueue_max);
P1B_SYSCTL(CTL_P1003_1B_TIMER_MAX, timer_max);
#define P31B_VALID(num) ((num) >= 1 && (num) < CTL_P1003_1B_MAXID)
+static int
+p31b_sysctl_proc(SYSCTL_HANDLER_ARGS)
+{
+ int error, num, val;
+
+ num = arg2;
+ if (!P31B_VALID(num))
+ return (EINVAL);
+ val = facility_initialized[num] ? facility[num - 1] : 0;
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error == 0 && req->newptr != NULL && facility_initialized[num])
+ facility[num - 1] = val;
+ return (error);
+}
+
/* p31b_setcfg: Set the configuration
*/
void
@@ -110,6 +132,14 @@ p31b_setcfg(int num, int value)
}
}
+void
+p31b_unsetcfg(int num)
+{
+
+ facility[num - 1] = 0;
+ facility_initialized[num -1] = 0;
+}
+
int
p31b_getcfg(int num)
{
Modified: user/jmallett/octeon/sys/kern/uipc_sem.c
==============================================================================
--- user/jmallett/octeon/sys/kern/uipc_sem.c Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/sys/kern/uipc_sem.c Wed Jun 2 11:21:35 2010 (r208741)
@@ -976,6 +976,8 @@ ksem_module_destroy(void)
sx_destroy(&ksem_dict_lock);
mtx_destroy(&ksem_count_lock);
mtx_destroy(&sem_lock);
+ p31b_unsetcfg(CTL_P1003_1B_SEM_VALUE_MAX);
+ p31b_unsetcfg(CTL_P1003_1B_SEM_NSEMS_MAX);
}
static int
Modified: user/jmallett/octeon/sys/sys/posix4.h
==============================================================================
--- user/jmallett/octeon/sys/sys/posix4.h Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/sys/sys/posix4.h Wed Jun 2 11:21:35 2010 (r208741)
@@ -64,6 +64,7 @@ int p31b_proc(struct proc *, pid_t, stru
void p31b_setcfg(int, int);
int p31b_getcfg(int);
int p31b_iscfg(int);
+void p31b_unsetcfg(int);
#ifdef _KPOSIX_PRIORITY_SCHEDULING
Copied: user/jmallett/octeon/tools/regression/usr.bin/jot/regress.rand1.out (from r208740, head/tools/regression/usr.bin/jot/regress.rand1.out)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/jmallett/octeon/tools/regression/usr.bin/jot/regress.rand1.out Wed Jun 2 11:21:35 2010 (r208741, copy of r208740, head/tools/regression/usr.bin/jot/regress.rand1.out)
@@ -0,0 +1,10 @@
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
Copied: user/jmallett/octeon/tools/regression/usr.bin/jot/regress.rand2.out (from r208740, head/tools/regression/usr.bin/jot/regress.rand2.out)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/jmallett/octeon/tools/regression/usr.bin/jot/regress.rand2.out Wed Jun 2 11:21:35 2010 (r208741, copy of r208740, head/tools/regression/usr.bin/jot/regress.rand2.out)
@@ -0,0 +1,10 @@
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
Modified: user/jmallett/octeon/tools/regression/usr.bin/jot/regress.sh
==============================================================================
--- user/jmallett/octeon/tools/regression/usr.bin/jot/regress.sh Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/tools/regression/usr.bin/jot/regress.sh Wed Jun 2 11:21:35 2010 (r208741)
@@ -1,6 +1,6 @@
# $FreeBSD$
-echo 1..57
+echo 1..60
REGRESSION_START($1)
@@ -32,12 +32,15 @@ REGRESSION_TEST(`hddd2', `jot 30 - - -')
REGRESSION_TEST(`dhhh2', `jot - 20 160 2')
REGRESSION_TEST(`dhhd2', `jot - 20 160 -')
REGRESSION_TEST(`ddhh2', `jot - - 160 2')
+REGRESSION_TEST(`rand1', `jot -r 10000 0 9 | sort -u')
+REGRESSION_TEST(`rand2', `jot -r 10000 9 0 | sort -u')
REGRESSION_TEST(`n21', `jot 21 -1 1.00')
REGRESSION_TEST(`ascii', `jot -c 128 0')
REGRESSION_TEST(`xaa', `jot -w xa%c 26 a')
REGRESSION_TEST(`yes', `jot -b yes 10')
REGRESSION_TEST(`ed', `jot -w %ds/old/new/ 30 2 - 5')
REGRESSION_TEST(`stutter', `jot - 9 0 -.5')
+REGRESSION_TEST(`stutter2', `jot -w %d - 9.5 0 -.5')
REGRESSION_TEST(`block', `jot -b x 512')
REGRESSION_TEST(`tabs', `jot -s, - 10 132 4')
REGRESSION_TEST(`grep', `jot -s "" -b . 80')
Copied: user/jmallett/octeon/tools/regression/usr.bin/jot/regress.stutter2.out (from r208740, head/tools/regression/usr.bin/jot/regress.stutter2.out)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/jmallett/octeon/tools/regression/usr.bin/jot/regress.stutter2.out Wed Jun 2 11:21:35 2010 (r208741, copy of r208740, head/tools/regression/usr.bin/jot/regress.stutter2.out)
@@ -0,0 +1,20 @@
+9
+9
+8
+8
+7
+7
+6
+6
+5
+5
+4
+4
+3
+3
+2
+2
+1
+1
+0
+0
Modified: user/jmallett/octeon/usr.bin/join/join.1
==============================================================================
--- user/jmallett/octeon/usr.bin/join/join.1 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/usr.bin/join/join.1 Wed Jun 2 11:21:35 2010 (r208741)
@@ -48,8 +48,6 @@
.Oc
.Op Fl e Ar string
.Op Fl o Ar list
-.Bk -words
-.Ek
.Op Fl t Ar char
.Op Fl 1 Ar field
.Op Fl 2 Ar field
Modified: user/jmallett/octeon/usr.bin/jot/jot.1
==============================================================================
--- user/jmallett/octeon/usr.bin/jot/jot.1 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/usr.bin/jot/jot.1 Wed Jun 2 11:21:35 2010 (r208741)
@@ -32,7 +32,7 @@
.\" @(#)jot.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd February 19, 2010
+.Dd June 2, 2010
.Dt JOT 1
.Os
.Sh NAME
@@ -167,6 +167,86 @@ The name
derives in part from
.Nm iota ,
a function in APL.
+.Ss Rounding and truncation
+The
+.Nm
+utility uses double precision floating point arithmetic internally.
+Before printing a number, it is converted depending on the output
+format used.
+.Pp
+If no output format is specified or the output format is a
+floating point format
+.Po
+.Sq E ,
+.Sq G ,
+.Sq e ,
+.Sq f ,
+or
+.Sq g
+.Pc ,
+the value is rounded using the
+.Xr printf 3
+function, taking into account the requested precision.
+.Pp
+If the output format is an integer format
+.Po
+.Sq D ,
+.Sq O ,
+.Sq U ,
+.Sq X ,
+.Sq c ,
+.Sq d ,
+.Sq i ,
+.Sq o ,
+.Sq u ,
+or
+.Sq x
+.Pc ,
+the value is converted to an integer value by truncation.
+.Pp
+As an illustration, consider the following command:
+.Bd -literal -offset indent
+$ jot 6 1 10 0.5
+1
+2
+2
+2
+3
+4
+.Ed
+.Pp
+By requesting an explicit precision of 1, the values generated before rounding
+can be seen.
+The .5 values are rounded down if the integer part is even,
+up otherwise.
+.Bd -literal -offset indent
+$ jot -p 1 6 1 10 0.5
+1.0
+1.5
+2.0
+2.5
+3.0
+3.5
+.Ed
+.Pp
+By offsetting the values slightly, the values generated by the following
+command are always rounded down:
+.Bd -literal -offset indent
+$ jot -p 0 6 .9999999999 10 0.5
+1
+1
+2
+2
+3
+3
+.Ed
+.Pp
+Another way of achieving the same result is to force truncation by
+specifying an integer format:
+.Bd -literal -offset indent
+$ jot -w %d 6 1 10 0.5
+.Ed
+.Pp
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
@@ -201,9 +281,9 @@ the result of
.Dl jot -w %ds/old/new/ 30 2 - 5
.Pp
The stuttering sequence 9, 9, 8, 8, 7, etc.\& can be
-produced by suitable choice of step size,
+produced by truncating the output precision and a suitable choice of step size,
as in
-.Dl jot - 9 0 -.5
+.Dl jot -w %d - 9.5 0 -.5
.Pp
and a file containing exactly 1024 bytes is created with
.Dl jot -b x 512 > block
Modified: user/jmallett/octeon/usr.bin/jot/jot.c
==============================================================================
--- user/jmallett/octeon/usr.bin/jot/jot.c Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/usr.bin/jot/jot.c Wed Jun 2 11:21:35 2010 (r208741)
@@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
#define is_default(s) (*(s) == 0 || strcmp((s), "-") == 0)
static bool boring;
-static int prec;
+static int prec = -1;
static bool longdata;
static bool intdata;
static bool chardata;
@@ -128,7 +128,7 @@ main(int argc, char **argv)
break;
case 'p':
prec = atoi(optarg);
- if (prec <= 0)
+ if (prec < 0)
errx(1, "bad precision value");
have_format = true;
break;
@@ -159,7 +159,7 @@ main(int argc, char **argv)
if (!sscanf(argv[2], "%lf", &ender))
ender = argv[2][strlen(argv[2])-1];
mask |= HAVE_ENDER;
- if (!prec)
+ if (prec < 0)
n = getprec(argv[2]);
}
/* FALLTHROUGH */
@@ -168,7 +168,7 @@ main(int argc, char **argv)
if (!sscanf(argv[1], "%lf", &begin))
begin = argv[1][strlen(argv[1])-1];
mask |= HAVE_BEGIN;
- if (!prec)
+ if (prec < 0)
prec = getprec(argv[1]);
if (n > prec) /* maximum precision */
prec = n;
@@ -188,6 +188,10 @@ main(int argc, char **argv)
argv[4]);
}
getformat();
+
+ if (prec == -1)
+ prec = 0;
+
while (mask) /* 4 bit mask has 1's where last 4 args were given */
switch (mask) { /* fill in the 0's by default or computation */
case HAVE_STEP:
@@ -284,13 +288,16 @@ main(int argc, char **argv)
if (!have_format && prec == 0 &&
begin >= 0 && begin < divisor &&
ender >= 0 && ender < divisor) {
- ender += 1;
+ if (begin <= ender)
+ ender += 1;
+ else
+ begin += 1;
nosign = true;
intdata = true;
(void)strlcpy(format,
chardata ? "%c" : "%u", sizeof(format));
}
- x = (ender - begin) * (ender > begin ? 1 : -1);
+ x = ender - begin;
for (i = 1; i <= reps || infinity; i++) {
if (use_random)
y = random() / divisor;
Modified: user/jmallett/octeon/usr.bin/newkey/newkey.8
==============================================================================
--- user/jmallett/octeon/usr.bin/newkey/newkey.8 Wed Jun 2 11:15:12 2010 (r208740)
+++ user/jmallett/octeon/usr.bin/newkey/newkey.8 Wed Jun 2 11:21:35 2010 (r208741)
@@ -16,13 +16,13 @@ The
.Nm
utility is normally run by the network administrator on the
Network Interface Service
-(\s-1NIS\s0)
+.Pq NIS
master machine in order to establish public keys for
users and super-users on the network.
These keys are needed for using secure
RPC
or secure
-NFS\s0.
+NFS .
.Pp
The
.Nm
@@ -52,8 +52,8 @@ password of the given username.
.Xr keyserv 8
.Sh NOTES
The Network Information Service
-(\s-1NIS\s0)
+.Pq NIS
was formerly known as Sun Yellow Pages
-(\s-1YP\s0).
+.Pq YP .
The functionality of the two remains the same;
only the name has changed.
More information about the svn-src-user
mailing list