From a3eabe598a0af8378581201cb0d027e3589fd3f7 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Fri, 29 Jul 2022 01:00:00 +0300 Subject: 14863 Makefile.syshdrs: machine specific headers appear to be quite common Reviewed by: Richard Lowe Reviewed by: Andrew Stormont Approved by: Patrick Mooney --- usr/src/uts/common/sys/Makefile | 6 ++++++ usr/src/uts/common/sys/Makefile.syshdrs | 23 ++++++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index 7aae55e661..70c8342377 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -1207,6 +1207,7 @@ CHECKHDRS= \ $(ROOTAVHDRS) \ $(ROOTCRYPTOHDRS) \ $(ROOTDCAMHDRS) \ + $(ROOTDKTPHDRS) \ $(ROOTISOHDRS) \ $(ROOTIDMHDRS) \ $(ROOTISCSIHDRS) \ @@ -1228,6 +1229,7 @@ CHECKHDRS= \ $(ROOTIBMFHDRS) \ $(ROOTOFHDRS) \ $(ROOTRDMAHDRS) \ + $(ROOTSATAGENHDRS) \ $(ROOTSOL_OFSHDRS) \ $(ROOTSOL_UMADHDRS) \ $(ROOTSOL_UVERBSHDRS) \ @@ -1243,6 +1245,7 @@ CHECKHDRS= \ $(ROOTSCSIGENHDRS) \ $(ROOTSCSIIMPLHDRS) \ $(ROOTSCSIVHCIHDRS) \ + $(ROOTSCSITARGETSHDRS) \ $(ROOTSDCARDHDRS) \ $(ROOTSYSEVENTHDRS) \ $(ROOTCONTRACTHDRS) \ @@ -1276,6 +1279,7 @@ install_h: \ $(ROOTAVHDRS) \ $(ROOTCRYPTOHDRS) \ $(ROOTDCAMHDRS) \ + $(ROOTDKTPHDRS) \ $(ROOTISOHDRS) \ $(ROOTIDMHDRS) \ $(ROOTISCSIHDRS) \ @@ -1297,6 +1301,7 @@ install_h: \ $(ROOTIBMFHDRS) \ $(ROOTOFHDRS) \ $(ROOTRDMAHDRS) \ + $(ROOTSATAGENHDRS) \ $(ROOTSOL_OFSHDRS) \ $(ROOTSOL_UMADHDRS) \ $(ROOTSOL_UVERBSHDRS) \ @@ -1312,6 +1317,7 @@ install_h: \ $(ROOTSCSIGENHDRS) \ $(ROOTSCSIIMPLHDRS) \ $(ROOTSCSIVHCIHDRS) \ + $(ROOTSCSITARGETSHDRS) \ $(ROOTSDCARDHDRS) \ $(ROOTSYSEVENTHDRS) \ $(ROOTCONTRACTHDRS) \ diff --git a/usr/src/uts/common/sys/Makefile.syshdrs b/usr/src/uts/common/sys/Makefile.syshdrs index 54a89a5e9a..b4b508cad4 100644 --- a/usr/src/uts/common/sys/Makefile.syshdrs +++ b/usr/src/uts/common/sys/Makefile.syshdrs @@ -173,19 +173,11 @@ tsol/%.check: tsol/%.h ROOTDIR= $(ROOT)/usr/include/sys -ROOTDKTPDIR= $(ROOTDIR)/dktp - -sparc_ROOTDIRS= $(ROOTDKTPDIR) $(ROOTDIR)/scsi/adapters \ - $(ROOTDIR)/scsi/targets - -i386_ROOTDIRS= $(ROOTDKTPDIR) $(ROOTDIR)/scsi/adapters \ - $(ROOTDIR)/scsi/targets \ - $(ROOTDIR)/sata - ROOTDIRS= \ $(ROOTDIR) \ $(ROOTDIR)/audio \ $(ROOTDIR)/av \ + $(ROOTDIR)/dktp \ $(ROOTDIR)/hotplug \ $(ROOTDIR)/hotplug/pci \ $(ROOTDIR)/crypto \ @@ -218,10 +210,13 @@ ROOTDIRS= \ $(ROOTDIR)/ib/clients/of/sol_ucma \ $(ROOTDIR)/idm \ $(ROOTDIR)/iscsit \ + $(ROOTDIR)/sata \ $(ROOTDIR)/scsi \ + $(ROOTDIR)/scsi/adapters \ $(ROOTDIR)/scsi/conf \ $(ROOTDIR)/scsi/generic \ $(ROOTDIR)/scsi/impl \ + $(ROOTDIR)/scsi/targets \ $(ROOTDIR)/sdcard \ $(ROOTDIR)/sysevent \ $(ROOTDIR)/contract \ @@ -290,7 +285,6 @@ ROOTSCSICONFHDRS= $(SCSICONFHDRS:%=$(ROOTDIR)/scsi/conf/%) ROOTSCSIGENHDRS= $(SCSIGENHDRS:%=$(ROOTDIR)/scsi/generic/%) ROOTSCSIIMPLHDRS= $(SCSIIMPLHDRS:%=$(ROOTDIR)/scsi/impl/%) ROOTSCSITARGETSHDRS= $(SCSITARGETSHDRS:%=$(ROOTDIR)/scsi/targets/%) -ROOTSCSICADHDRS= $(SCSICADHDRS:%=$(ROOTDIR)/scsi/adapters/%) ROOTSCSIADHDRS= $(SCSICADHDRS:%=$(ROOTDIR)/scsi/adapters/%) ROOTSCSIVHCIHDRS= $(SCSIVHCIHDRS:%=$(ROOTDIR)/scsi/adapters/%) ROOTSCSIISCSIHDRS= $(SCSIISCSIHDRS:%=$(ROOTDIR)/scsi/adapters/%) @@ -323,7 +317,6 @@ ROOT1394HDRS= $(I1394HDRS:%=$(ROOTDIR)/1394/%) ROOTRSMHDRS= $(RSMHDRS:%=$(ROOTDIR)/rsm/%) -ROOTSDKTPHDRS= $(SDKTPHDRS:%=$(ROOTDIR)/dktp/%) ROOTDKTPHDRS= $(DKTPHDRS:%=$(ROOTDIR)/dktp/%) ROOTPCHDRS= $(PCHDRS:%=$(ROOTDIR)/%) ROOTHOTPLUGHDRS= $(HOTPLUGHDRS:%=$(ROOTDIR)/hotplug/%) @@ -331,14 +324,14 @@ ROOTHOTPLUGPCIHDRS= $(HOTPLUGPCIHDRS:%=$(ROOTDIR)/hotplug/pci/%) ROOTTSOLHDRS= $(TSOLHDRS:%=$(ROOTDIR)/tsol/%) -sparc_ROOTHDRS= $(ROOTSDKTPHDRS) $(ROOTSCSICADHDRS) $(ROOTSCSITARGETSHDRS) \ +sparc_ROOTHDRS= \ $(ROOTUSBHDRS) $(ROOTUSBHUBDHDRS) \ $(ROOTUSBAUDHDRS) $(ROOTUSBHIDHDRS) $(ROOTUSBMSHDRS) \ $(ROOTUSBPRNHDRS) $(ROOTUGENHDRS) $(ROOTUSBVIDHDRS) -i386_ROOTHDRS= $(ROOTDKTPHDRS) $(ROOTPCHDRS) $(ROOTSCSITARGETSHDRS) \ - $(ROOTSCSIVHCIHDRS) $(ROOTHOTPLUGHDRS) \ - $(ROOTHOTPLUGPCIHDRS) $(ROOTSATAGENHDRS) +i386_ROOTHDRS= $(ROOTPCHDRS) \ + $(ROOTHOTPLUGHDRS) \ + $(ROOTHOTPLUGPCIHDRS) # install rules $(ROOTDIR)/%: % -- cgit v1.2.3 From 589f9b6223af8482576c4b68c4acc0626246eb32 Mon Sep 17 00:00:00 2001 From: Vitaliy Gusev Date: Thu, 8 Feb 2018 14:03:12 +0300 Subject: 14958 fakekernel: avoid LWP threads Reviewed by: Toomas Soome Reviewed by: Gordon Ross Reviewed by: Matt Barden Approved by: Patrick Mooney --- usr/src/lib/libfakekernel/common/thread.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'usr/src') diff --git a/usr/src/lib/libfakekernel/common/thread.c b/usr/src/lib/libfakekernel/common/thread.c index 31421a723b..d20bd9b91b 100644 --- a/usr/src/lib/libfakekernel/common/thread.c +++ b/usr/src/lib/libfakekernel/common/thread.c @@ -11,13 +11,14 @@ /* * Copyright 2013 Nexenta Systems, Inc. All rights reserved. - * Copyright 2017 RackTop Systems. + * Copyright 2018 RackTop Systems. */ #include #include #include #include +#include #define _SYNCH_H /* keep out */ #include @@ -81,6 +82,14 @@ thread_create( void thread_exit(void) { + static thread_t reap_tid; + thread_t prev; + + /* reap previous thread exit */ + prev = atomic_swap_uint(&reap_tid, thr_self()); + if (prev != 0) + (void) thr_join(prev, NULL, NULL); /* joinable thread */ + thr_exit(NULL); } -- cgit v1.2.3 From bbcfe1fdf407bba4db5c2e62a69b67be0c4cb443 Mon Sep 17 00:00:00 2001 From: Gordon Ross Date: Fri, 8 Oct 2021 10:39:15 -0400 Subject: 14987 smb: DsFreeDcInfo leaks Reviewed-by: Toomas Soome Reviewed-by: Garrett D'Amore Reviewed-by: Jim Johnson Reviewed-by: Jerry Jelinek Reviewed by: Gordon Ross Reviewed by: Matt Barden Reviewed by: Andrew Stormont Approved by: Patrick Mooney --- usr/src/cmd/idmap/nltest/nltest.c | 26 +++++++++++++++----------- usr/src/lib/libads/common/dsgetdc.c | 8 ++++---- 2 files changed, 19 insertions(+), 15 deletions(-) (limited to 'usr/src') diff --git a/usr/src/cmd/idmap/nltest/nltest.c b/usr/src/cmd/idmap/nltest/nltest.c index 002fe0f157..b86d473f2f 100644 --- a/usr/src/cmd/idmap/nltest/nltest.c +++ b/usr/src/cmd/idmap/nltest/nltest.c @@ -11,6 +11,7 @@ /* * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright 2021 RackTop Systems, Inc. */ @@ -184,6 +185,8 @@ cmd_dsgetdcname(char *domname) (void) printf(" DC Site Name: %s \n", dcinfo->DcSiteName); (void) printf(" Client Site Name: %s \n", dcinfo->ClientSiteName); + DsFreeDcInfo(dcinfo); + return (0); } @@ -214,7 +217,8 @@ cmd_kick(char *domname) */ static void -help(void) { +help(void) +{ (void) printf("\n"); /* * TODO: We may want to revise this help text. It's basically @@ -225,17 +229,17 @@ help(void) { (char *)getexecname()); (void) printf(gettext("where subcommands are:\n" #if 0 /* not yet */ - " dclist Lists all domain controllers in the domain.\n" - " dcname Lists the PDC or PDC emulator.\n" - " dsgetdc Queries DNS server for list of DCs and" - " their IP addresses and contacts each DC to check" - " for connectivity.\n" + " dclist Lists all domain controllers in the domain.\n" + " dcname Lists the PDC or PDC emulator.\n" + " dsgetdc Queries DNS server for list of DCs and" + " their IP addresses and contacts each DC to check" + " for connectivity.\n" #endif - " dsgetdcname returns the name of a domain controller in a" - " specified domain\n" - " help display help on specified subcommand\n" - " kick trigger domain controller re-discovery\n" - "\n")); + " dsgetdcname returns the name of a domain controller in a" + " specified domain\n" + " help display help on specified subcommand\n" + " kick trigger domain controller re-discovery\n" + "\n")); exit(1); } diff --git a/usr/src/lib/libads/common/dsgetdc.c b/usr/src/lib/libads/common/dsgetdc.c index a8b45707b9..ae2eddb24e 100644 --- a/usr/src/lib/libads/common/dsgetdc.c +++ b/usr/src/lib/libads/common/dsgetdc.c @@ -11,6 +11,7 @@ /* * Copyright 2014 Nexenta Systems, Inc. All rights reserved. + * Copyright 2021 RackTop Systems, Inc. */ /* @@ -24,7 +25,7 @@ #include #include "dsgetdc.h" #include "ads_priv.h" -#include +#include #define DSGETDC_VALID_FLAGS ( \ DS_FORCE_REDISCOVERY | \ @@ -112,8 +113,7 @@ _DsGetDcName(const char *ComputerName, * We have taken pains to make these two the same. * DOMAIN_CONTROLLER_INFO / struct adspriv_dcinfo */ - /* LINTED E_TRUE_LOGICAL_EXPR */ - assert(sizeof (**dcinfo) == sizeof (res.DsGetDcNameRes_u.res0)); + CTASSERT(sizeof (**dcinfo) == sizeof (res.DsGetDcNameRes_u.res0)); (void) memcpy(*dcinfo, &res.DsGetDcNameRes_u.res0, sizeof (**dcinfo)); /* @@ -156,7 +156,7 @@ void DsFreeDcInfo(DOMAIN_CONTROLLER_INFO *dci) { if (dci != NULL) { - xdr_free(xdr_DsGetDcNameRes, (char *)dci); + xdr_free(xdr_adspriv_dcinfo, (char *)dci); free(dci); } } -- cgit v1.2.3