summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/Makefile.master2
-rw-r--r--usr/src/cmd/grep/grep.c20
-rw-r--r--usr/src/cmd/rpcgen/Makefile18
-rw-r--r--usr/src/cmd/rpcgen/Makefile.common36
-rw-r--r--usr/src/pkg/manifests/system-test-utiltest.mf4
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/Makefile5
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout671
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout681
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout691
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout701
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh44
-rw-r--r--usr/src/tools/Makefile1
-rw-r--r--usr/src/tools/rpcgen/Makefile37
-rw-r--r--usr/src/uts/common/sys/ddi_ufm.h4
14 files changed, 147 insertions, 28 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index 659edcf19c..7c036ac21a 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -148,7 +148,7 @@ GCCLIBDIR64= $(GNUC_ROOT)/lib/$(MACH64)
DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
-RPCGEN= /usr/bin/rpcgen
+RPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/rpcgen
STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
diff --git a/usr/src/cmd/grep/grep.c b/usr/src/cmd/grep/grep.c
index 7054d1f602..ac51023678 100644
--- a/usr/src/cmd/grep/grep.c
+++ b/usr/src/cmd/grep/grep.c
@@ -35,6 +35,7 @@
*/
/*
+ * Copyright 2020 Peter Tribble.
* Copyright 2018 RackTop Systems.
* Copyright 2018 Nexenta Systems, Inc.
* Copyright 2013 Damian Bogel. All rights reserved.
@@ -64,8 +65,8 @@
#define BUFSIZE 8192 /* Input buffer size */
#define MAX_DEPTH 1000 /* how deep to recurse */
-#define AFTER 1 /* 'After' Context */
-#define BEFORE 2 /* 'Before' Context */
+#define AFTER 1 /* 'After' Context */
+#define BEFORE 2 /* 'Before' Context */
#define CONTEXT (AFTER|BEFORE) /* Full Context */
#define M_CSETSIZE 256 /* singlebyte chars */
@@ -91,11 +92,11 @@ static boolean_t nvflag = B_TRUE; /* Print matching lines */
static uchar_t cflag; /* Count of matches */
static uchar_t iflag; /* Case insensitve matching */
static uchar_t Hflag; /* Precede lines by file name */
-static uchar_t hflag; /* Supress printing of filename */
+static uchar_t hflag; /* Suppress printing of filename */
static uchar_t lflag; /* Print file names of matches */
static uchar_t nflag; /* Precede lines by line number */
static uchar_t rflag; /* Search directories recursively */
-static uchar_t bflag; /* Preccede matches by block number */
+static uchar_t bflag; /* Precede matches by block number */
static uchar_t sflag; /* Suppress file error messages */
static uchar_t qflag; /* Suppress standard output */
static uchar_t wflag; /* Search for expression as a word */
@@ -110,7 +111,7 @@ static char *cmdname;
static int use_wchar, use_bmg, mblocale;
static size_t outbuflen, prntbuflen, conbuflen;
-static unsigned long conalen, conblen, conmatches;
+static unsigned long conalen, conblen, conmatches;
static char *prntbuf, *conbuf;
static wchar_t *outline;
@@ -264,11 +265,11 @@ main(int argc, char **argv)
break;
/* based on options order h or H is set as in GNU grep */
- case 'h': /* Solaris: supress printing of file name */
+ case 'h': /* Solaris: suppress printing of file name */
hflag = 1;
Hflag = 0;
break;
- /* Solaris: precede every matching with file name */
+ /* Solaris: precede every match with file name */
case 'H':
Hflag = 1;
hflag = 0;
@@ -485,7 +486,8 @@ process_path(const char *path)
if (rflag) {
if (stat(path, &st) != -1 &&
(st.st_mode & S_IFMT) == S_IFDIR) {
- outfn = 1; /* Print filename */
+ if (!hflag)
+ outfn = 1; /* Print filename unless -h */
/*
* Add trailing slash if arg
@@ -898,7 +900,7 @@ grep(int fd, const char *fn)
off_t blkoffset; /* line_offset but context-compatible */
long long lineno, linenum;
long long matches = 0; /* Number of matching lines */
- long long conacnt = 0, conbcnt = 0; /* context line count */
+ long long conacnt = 0, conbcnt = 0; /* context line count */
int newlinep; /* 0 if the last line of file has no newline */
char *ptr, *ptrend, *prntptr, *prntptrend;
char *nextptr = NULL, *nextend = NULL;
diff --git a/usr/src/cmd/rpcgen/Makefile b/usr/src/cmd/rpcgen/Makefile
index 0d0dd2f82c..352ef22446 100644
--- a/usr/src/cmd/rpcgen/Makefile
+++ b/usr/src/cmd/rpcgen/Makefile
@@ -25,24 +25,12 @@
#
# cmd/rpcgen/Makefile
-PROG= rpcgen
-
-
-OBJS= rpc_clntout.o rpc_cout.o rpc_hout.o rpc_main.o rpc_parse.o \
- rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o
-SRCS= $(OBJS:%.o=%.c)
-
include ../Makefile.cmd
-
-LDLIBS +=
-CFLAGS += $(CCVERBOSE)
-CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-char-subscripts
+include Makefile.common
.KEEP_STATE:
-all: $(PROG)
+all: $(PROG)
$(PROG): $(OBJS)
$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
@@ -53,6 +41,4 @@ install: all $(ROOTPROG)
clean:
$(RM) $(OBJS)
-lint: lint_SRCS
-
include ../Makefile.targ
diff --git a/usr/src/cmd/rpcgen/Makefile.common b/usr/src/cmd/rpcgen/Makefile.common
new file mode 100644
index 0000000000..a5cfe7d878
--- /dev/null
+++ b/usr/src/cmd/rpcgen/Makefile.common
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# cmd/rpcgen/Makefile
+
+PROG= rpcgen
+
+OBJS= rpc_clntout.o rpc_cout.o rpc_hout.o rpc_main.o rpc_parse.o \
+ rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o
+SRCS= $(OBJS:%.o=%.c)
+
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-char-subscripts
diff --git a/usr/src/pkg/manifests/system-test-utiltest.mf b/usr/src/pkg/manifests/system-test-utiltest.mf
index 9c41f4a108..c4fb87d26e 100644
--- a/usr/src/pkg/manifests/system-test-utiltest.mf
+++ b/usr/src/pkg/manifests/system-test-utiltest.mf
@@ -1432,7 +1432,11 @@ file path=opt/util-tests/tests/files/gout63 mode=0444
file path=opt/util-tests/tests/files/gout64 mode=0444
file path=opt/util-tests/tests/files/gout65 mode=0444
file path=opt/util-tests/tests/files/gout66 mode=0444
+file path=opt/util-tests/tests/files/gout67 mode=0444
+file path=opt/util-tests/tests/files/gout68 mode=0444
+file path=opt/util-tests/tests/files/gout69 mode=0444
file path=opt/util-tests/tests/files/gout7 mode=0444
+file path=opt/util-tests/tests/files/gout70 mode=0444
file path=opt/util-tests/tests/files/gout8 mode=0444
file path=opt/util-tests/tests/files/gout9 mode=0444
file path=opt/util-tests/tests/files/make_a/Makefile mode=0444
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile b/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile
index cec093b8a1..1d332a352f 100644
--- a/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile
@@ -12,6 +12,7 @@
#
# Copyright (c) 2013 by Delphix. All rights reserved.
# Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2020 Peter Tribble.
#
include $(SRC)/cmd/Makefile.cmd
@@ -95,6 +96,10 @@ PROGS = test0 \
gout64 \
gout65 \
gout66 \
+ gout67 \
+ gout68 \
+ gout69 \
+ gout70 \
testnl
CMDS = $(PROGS:%=$(TESTDIR)/%)
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout67 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout67
new file mode 100644
index 0000000000..7898192261
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout67
@@ -0,0 +1 @@
+a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout68 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout68
new file mode 100644
index 0000000000..f69ef4b88d
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout68
@@ -0,0 +1 @@
+test0:a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout69 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout69
new file mode 100644
index 0000000000..88ccf63397
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout69
@@ -0,0 +1 @@
+/tmp/test0/test0:a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout70 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout70
new file mode 100644
index 0000000000..7898192261
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout70
@@ -0,0 +1 @@
+a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
index 0f4b77f9c9..f71cd98276 100644
--- a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
+++ b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
@@ -13,6 +13,7 @@
#
# Copyright 2017 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2020 Peter Tribble.
#
XGREP=${XGREP:=/usr/bin/grep}
@@ -147,3 +148,46 @@ while read flags; do
echo "passed"
((i++))
done < /tmp/flags
+
+FLAGS4="-h
+-H"
+
+echo "$FLAGS4" > /tmp/flags
+
+while read flags; do
+ print -n "test $i: grep $flags: "
+ $XGREP $flags a test0 > out
+ err="$?"
+ if [[ $err -ne 0 ]]; then
+ fail "failed on exit: $err"
+ elif [ -n "$(diff out gout$i)" ]; then
+ print "$(diff out gout$i)"
+ fail "output is different"
+ fi
+ echo "passed"
+ ((i++))
+done < /tmp/flags
+
+FLAGS5="-r
+-hr"
+
+# need a directory with predictable contents
+rm -fr /tmp/test0
+mkdir /tmp/test0
+cp test0 /tmp/test0
+
+echo "$FLAGS5" > /tmp/flags
+
+while read flags; do
+ print -n "test $i: grep $flags: "
+ $XGREP $flags a /tmp/test0 > out
+ err="$?"
+ if [[ $err -ne 0 ]]; then
+ fail "failed on exit: $err"
+ elif [ -n "$(diff out gout$i)" ]; then
+ print "$(diff out gout$i)"
+ fail "output is different"
+ fi
+ echo "passed"
+ ((i++))
+done < /tmp/flags
diff --git a/usr/src/tools/Makefile b/usr/src/tools/Makefile
index 60c74fb342..64bd18f4e0 100644
--- a/usr/src/tools/Makefile
+++ b/usr/src/tools/Makefile
@@ -77,6 +77,7 @@ UNSHIPPED_SUBDIRS = \
localedef \
man \
mandoc \
+ rpcgen \
tic \
vtfontcvt \
zic
diff --git a/usr/src/tools/rpcgen/Makefile b/usr/src/tools/rpcgen/Makefile
new file mode 100644
index 0000000000..6108ec0700
--- /dev/null
+++ b/usr/src/tools/rpcgen/Makefile
@@ -0,0 +1,37 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2020 Toomas Soome <tsoome@me.com>
+#
+
+CMDDIR= $(SRC)/cmd/rpcgen
+
+include ../Makefile.tools
+include $(CMDDIR)/Makefile.common
+
+.KEEP_STATE:
+
+all: $(PROG)
+
+install: all .WAIT $(ROOTONBLDMACHPROG)
+
+clean:
+ $(RM) $(PROG) $(OBJS)
+
+$(PROG): $(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
+ $(POST_PROCESS)
+
+%.o: $(CMDDIR)/%.c
+ $(COMPILE.c) -o $@ $<
+
+include ../Makefile.targ
diff --git a/usr/src/uts/common/sys/ddi_ufm.h b/usr/src/uts/common/sys/ddi_ufm.h
index e6ad50d9ef..42d8ff72e6 100644
--- a/usr/src/uts/common/sys/ddi_ufm.h
+++ b/usr/src/uts/common/sys/ddi_ufm.h
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
*/
#ifndef _SYS_DDI_UFM_H
@@ -51,7 +51,7 @@ extern "C" {
* the UFM_IOC_GETCAPS should be extended appropriately.
*/
typedef enum {
- DDI_UFM_CAP_REPORT = 1 << 0,
+ DDI_UFM_CAP_REPORT = 1 << 0
} ddi_ufm_cap_t;
/*