svn commit: r298253 - head/usr.bin/units

2016-04-18 Thread Eitan Adler
Author: eadler
Date: Tue Apr 19 05:17:59 2016
New Revision: 298253
URL: https://svnweb.freebsd.org/changeset/base/298253

Log:
  Rename units.lib -> definitions.units
  - this matches GNU units 2.12
  add ISO country codes from units 2.12

Added:
  head/usr.bin/units/definitions.units
 - copied, changed from r298252, head/usr.bin/units/units.lib
Deleted:
  head/usr.bin/units/units.lib
Modified:
  head/usr.bin/units/units.1
  head/usr.bin/units/units.c

Copied and modified: head/usr.bin/units/definitions.units (from r298252, 
head/usr.bin/units/units.lib)
==
--- head/usr.bin/units/units.libTue Apr 19 05:17:43 2016
(r298252, copy source)
+++ head/usr.bin/units/definitions.unitsTue Apr 19 05:17:59 2016
(r298253)
@@ -363,6 +363,170 @@ lithuanianlitas   1|3.45280 euro
 pacificfrancexchange   1|0.00838 euro
 westafricancfafranc1|655.957 euro
 
+# ISO Currency Codes
+
+AEDuaedirham
+AFNafghanafghani
+ALLalbanialek
+AMDarmeniadram
+AOAangolakwanza
+ARSargentinapeso
+AUDaustraliadollar
+AWGarubaflorin
+AZNazerbaijanmanat
+BAMbosniaconvertiblemark
+BBDbarbadosdollar
+BDTbangladeshtaka
+BGNbulgarialev
+BHDbahraindinar
+BIFburundifranc
+BMDbermudadollar
+BNDbruneidollar
+BOBboliviaboliviano
+BRLbrazilreal
+BSDbahamasdollar
+BTNbhutanngultrum
+BWPbotswanapula
+BYRbelarusruble
+BZDbelizedollar
+CADcanadadollar
+CDFdrcfranccongolais
+CHFswissfranc
+CLPchilepeso
+CMGsintmaartencaribbeanguilder
+CNYchinayuan
+COPcolombiapeso
+CRCcostaricacolon
+CUPcubapeso
+CVEcapeverdeescudo
+CZKczechkoruna
+DJFdjiboutifranc
+DKKdenmarkkrona
+DOPdominicanrepublicpeso
+DZDalgeriadinar
+EGPegyptpound
+ERNeritreanakfa
+ETBethiopianbirr
+EUReuro
+FJDfijidollar
+FKPfalklandislandspound
+GBPukpound
+GELgeorgialari
+GGPguernseypound
+GHSghanacedi
+GIPgibraltarpound
+GMDgambiadalasi
+GNFguineafranc
+GTQguatemalaquetzal
+GYDguyanadollar
+HKDhongkongdollar
+HNLhonduraslempira
+HRKcroatiakuna
+HTGhaitigourde
+HUFhungariaforint
+IDRindonesiarupiah
+ILSisraelnewshekel
+IMPmanxpound
+INRindiarupee
+IQDiraqdinar
+IRRiranrial
+ISKicelandkrona
+JEPjerseypound
+JMDjamaicadollar
+JODjordandinar
+JPYjapanyen
+KESkenyaschilling
+KGSkyrgyzstansom
+KHRcambodiariel
+KMFcomorosfranc
+KPWnorthkoreawon
+KRWsouthkoreawon
+KWDkuwaitdinar
+KYDcaymanislandsdollar
+KZTkazakhstantenge
+LAKlaokip
+LBPlebanonpound
+LKRsrilankanrupee
+LRDliberiadollar
+LTLlithuanialita
+LVLlatvialat
+LYDlibyadinar
+MADmoroccodirham
+MDLmoldovaleu
+MGAmadagascarariary
+MKDmacedoniadenar
+MMKmyanmarkyat
+MNTmongoliatugrik
+MOPmacaupataca
+MROmauritaniaouguiya
+MURmauritiusrupee
+MVRmaldiverufiyaa
+MWKmalawikwacha
+MXNmexicopeso
+MYRmalaysiaringgit
+MZNmozambicanmetical
+NADnamibiadollar
+NGNnigerianaira
+NIOnicaraguacordobaoro
+NOKnorwaykrone
+NPRnepalrupee
+NZDnewzealanddollar
+OMR  

svn commit: r298254 - head

2016-04-18 Thread Eitan Adler
Author: eadler
Date: Tue Apr 19 05:18:12 2016
New Revision: 298254
URL: https://svnweb.freebsd.org/changeset/base/298254

Log:
  Rename units.lib -> definitions.units
  - this matches GNU units 2.12
  add ISO country codes from units 2.12

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Apr 19 05:17:59 2016(r298253)
+++ head/ObsoleteFiles.inc  Tue Apr 19 05:18:12 2016(r298254)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20160419: rename units.lib -> definitions.units
+OLD_FILES+=usr/share/misc/units.lib
 # 20160419: remove Big5HKSCS locales
 OLD_FILES+=usr/share/locale/zh_HK.Big5HKSCS/LC_COLLATE
 OLD_FILES+=usr/share/locale/zh_HK.Big5HKSCS/LC_CTYPE
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298252 - head/sbin/ifconfig

2016-04-18 Thread Adrian Chadd
Author: adrian
Date: Tue Apr 19 05:17:43 2016
New Revision: 298252
URL: https://svnweb.freebsd.org/changeset/base/298252

Log:
  Add VHT power envelope parsing to ifconfig.

Modified:
  head/sbin/ifconfig/ifieee80211.c

Modified: head/sbin/ifconfig/ifieee80211.c
==
--- head/sbin/ifconfig/ifieee80211.cTue Apr 19 05:04:39 2016
(r298251)
+++ head/sbin/ifconfig/ifieee80211.cTue Apr 19 05:17:43 2016
(r298252)
@@ -2573,6 +2573,39 @@ printvhtinfo(const char *tag, const u_in
 }
 
 static void
+printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
+{
+   printf("%s", tag);
+   static const char *txpwrmap[] = {
+   "20",
+   "40",
+   "80",
+   "160",
+   };
+   if (verbose) {
+   const struct ieee80211_ie_vht_txpwrenv *vhtpwr =
+   (const struct ieee80211_ie_vht_txpwrenv *) ie;
+   int i, n;
+   const char *sep = "";
+
+   /* Get count; trim at ielen */
+   n = (vhtpwr->tx_info &
+   IEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK) + 1;
+   /* Trim at ielen */
+   if (n > ielen - 3)
+   n = ielen - 3;
+   printf("tx_info);
+   for (i = 0; i < n; i++) {
+   printf("%s%s:%.2f", sep, txpwrmap[i],
+   ((float) ((int8_t) ie[i+3])) / 2.0);
+   sep = " ";
+   }
+
+   printf("]>");
+   }
+}
+
+static void
 printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
 {
printf("%s", tag);
@@ -3151,7 +3184,6 @@ iename(int elemid)
case IEEE80211_ELEMID_IBSSDFS:  return " IBSSDFS";
case IEEE80211_ELEMID_TPC:  return " TPC";
case IEEE80211_ELEMID_CCKM: return " CCKM";
-   case IEEE80211_ELEMID_VHT_PWR_ENV:  return " VHTPWRENV";
}
return " ???";
 }
@@ -3222,6 +3254,9 @@ printies(const u_int8_t *vp, int ielen, 
case IEEE80211_ELEMID_VHT_OPMODE:
printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols);
break;
+   case IEEE80211_ELEMID_VHT_PWR_ENV:
+   printvhtpwrenv(" VHTPWRENV", vp, 2+vp[1], maxcols);
+   break;
case IEEE80211_ELEMID_BSSLOAD:
printbssload(" BSSLOAD", vp, 2+vp[1], maxcols);
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298251 - head/usr.bin/units

2016-04-18 Thread Eitan Adler
Author: eadler
Date: Tue Apr 19 05:04:39 2016
New Revision: 298251
URL: https://svnweb.freebsd.org/changeset/base/298251

Log:
  Remove pathnames.h
  - it only holds a single constant
  - it doesn't exist in the GNU variant

Deleted:
  head/usr.bin/units/pathnames.h
Modified:
  head/usr.bin/units/units.c

Modified: head/usr.bin/units/units.c
==
--- head/usr.bin/units/units.c  Tue Apr 19 04:57:57 2016(r298250)
+++ head/usr.bin/units/units.c  Tue Apr 19 05:04:39 2016(r298251)
@@ -33,7 +33,7 @@ static const char rcsid[] =
 
 #include 
 
-#include "pathnames.h"
+#define_PATH_UNITSLIB  "/usr/share/misc/units.lib"
 
 #ifndef UNITSFILE
 #define UNITSFILE _PATH_UNITSLIB
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298244 - head/sbin/dumpon

2016-04-18 Thread Marcelo Araujo
2016-04-19 12:58 GMT+08:00 Pedro Giffuni :

>
>
> On 04/18/16 23:28, Marcelo Araujo wrote:
>
>> Author: araujo
>> Date: Tue Apr 19 04:28:25 2016
>> New Revision: 298244
>> URL: https://svnweb.freebsd.org/changeset/base/298244
>>
>> Log:
>>   Use nitems() instead of sizeof(name) / sizeof(*name).
>>
>>   MFC after:2 weeks.
>>
>>
> FWIW, while I see why it makes sense to make these cosmetic
> changes, it's probably too much to MFC them.
>
> At least I have no plans to merge the ones I've made since
> they are non-functional.
>
> Pedro.
>

I was thinking to MFC it at once(less work)! As now I'm checking/committing
one by one.


Best,
-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298244 - head/sbin/dumpon

2016-04-18 Thread Pedro Giffuni



On 04/18/16 23:28, Marcelo Araujo wrote:

Author: araujo
Date: Tue Apr 19 04:28:25 2016
New Revision: 298244
URL: https://svnweb.freebsd.org/changeset/base/298244

Log:
  Use nitems() instead of sizeof(name) / sizeof(*name).

  MFC after:2 weeks.



FWIW, while I see why it makes sense to make these cosmetic
changes, it's probably too much to MFC them.

At least I have no plans to merge the ones I've made since
they are non-functional.

Pedro.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298250 - in head/sbin: newfs_msdos newfs_nandfs

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 04:57:57 2016
New Revision: 298250
URL: https://svnweb.freebsd.org/changeset/base/298250

Log:
  Use nitems() from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/sbin/newfs_msdos/mkfs_msdos.c
  head/sbin/newfs_nandfs/newfs_nandfs.c

Modified: head/sbin/newfs_msdos/mkfs_msdos.c
==
--- head/sbin/newfs_msdos/mkfs_msdos.c  Tue Apr 19 04:52:51 2016
(r298249)
+++ head/sbin/newfs_msdos/mkfs_msdos.c  Tue Apr 19 04:57:57 2016
(r298250)
@@ -760,7 +760,7 @@ getstdfmt(const char *fmt, struct bpb *b
 {
 u_int x, i;
 
-x = sizeof(stdfmt) / sizeof(stdfmt[0]);
+x = nitems(stdfmt);
 for (i = 0; i < x && strcmp(fmt, stdfmt[i].name); i++);
 if (i == x) {
warnx("%s: unknown standard format", fmt);

Modified: head/sbin/newfs_nandfs/newfs_nandfs.c
==
--- head/sbin/newfs_nandfs/newfs_nandfs.c   Tue Apr 19 04:52:51 2016
(r298249)
+++ head/sbin/newfs_nandfs/newfs_nandfs.c   Tue Apr 19 04:57:57 2016
(r298250)
@@ -808,7 +808,7 @@ create_fs(void)
char *data;
int i;
 
-   nuserfiles = (sizeof(user_files) / sizeof(user_files[0]));
+   nuserfiles = nitems(user_files);
 
/* Count and assign blocks */
count_seg_blocks();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298249 - head/sbin/kldload

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 04:52:51 2016
New Revision: 298249
URL: https://svnweb.freebsd.org/changeset/base/298249

Log:
  Use nitems() from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/sbin/kldload/kldload.c

Modified: head/sbin/kldload/kldload.c
==
--- head/sbin/kldload/kldload.c Tue Apr 19 04:52:13 2016(r298248)
+++ head/sbin/kldload/kldload.c Tue Apr 19 04:52:51 2016(r298249)
@@ -74,7 +74,7 @@ path_check(const char *kldname, int quie
dev = sb.st_dev;
ino = sb.st_ino;
 
-   miblen = sizeof(mib) / sizeof(mib[0]);
+   miblen = nitems(mib);
if (sysctlnametomib(PATHCTL, mib, ) != 0) {
err(1, "sysctlnametomib(%s)", PATHCTL);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298248 - head/sbin/kldconfig

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 04:52:13 2016
New Revision: 298248
URL: https://svnweb.freebsd.org/changeset/base/298248

Log:
  Use nitems() from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/sbin/kldconfig/kldconfig.c

Modified: head/sbin/kldconfig/kldconfig.c
==
--- head/sbin/kldconfig/kldconfig.c Tue Apr 19 04:46:13 2016
(r298247)
+++ head/sbin/kldconfig/kldconfig.c Tue Apr 19 04:52:13 2016
(r298248)
@@ -85,7 +85,7 @@ getmib(void)
if (miblen != 0)
return;

-   miblen = sizeof(mib) / sizeof(mib[0]);
+   miblen = nitems(mib);
if (sysctlnametomib(pathctl, mib, ) != 0)
err(1, "sysctlnametomib(%s)", pathctl);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298247 - head/sbin/fdisk_pc98

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 04:46:13 2016
New Revision: 298247
URL: https://svnweb.freebsd.org/changeset/base/298247

Log:
  Remove redundant parenthesis.
  
  Submitted by: pfg
  MFC after:2 weeks.

Modified:
  head/sbin/fdisk_pc98/fdisk.c

Modified: head/sbin/fdisk_pc98/fdisk.c
==
--- head/sbin/fdisk_pc98/fdisk.cTue Apr 19 04:42:34 2016
(r298246)
+++ head/sbin/fdisk_pc98/fdisk.cTue Apr 19 04:46:13 2016
(r298247)
@@ -854,7 +854,7 @@ string(const char *str, char **ans)
 static const char *
 get_type(int type)
 {
-   int numentries = (nitems(part_types));
+   int numentries = nitems(part_types);
int counter = 0;
struct  part_type *ptr = part_types;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298246 - head/sbin/ifconfig

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 04:42:34 2016
New Revision: 298246
URL: https://svnweb.freebsd.org/changeset/base/298246

Log:
  Use nitems() from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/sbin/ifconfig/ifbridge.c
  head/sbin/ifconfig/iflagg.c

Modified: head/sbin/ifconfig/ifbridge.c
==
--- head/sbin/ifconfig/ifbridge.c   Tue Apr 19 04:37:17 2016
(r298245)
+++ head/sbin/ifconfig/ifbridge.c   Tue Apr 19 04:42:34 2016
(r298246)
@@ -185,22 +185,19 @@ bridge_interfaces(int s, const char *pre
printf(" path cost %u", req->ifbr_path_cost);
 
if (req->ifbr_ifsflags & IFBIF_STP) {
-   if (req->ifbr_proto <
-   sizeof(stpproto) / sizeof(stpproto[0]))
+   if (req->ifbr_proto < nitems(stpproto))
printf(" proto %s", stpproto[req->ifbr_proto]);
else
printf(" ",
req->ifbr_proto);
 
printf("\n%s", pad);
-   if (req->ifbr_role <
-   sizeof(stproles) / sizeof(stproles[0]))
+   if (req->ifbr_role < nitems(stproles))
printf("role %s", stproles[req->ifbr_role]);
else
printf("",
req->ifbr_role);
-   if (req->ifbr_state <
-   sizeof(stpstates) / sizeof(stpstates[0]))
+   if (req->ifbr_state < nitems(stpstates))
printf(" state %s", stpstates[req->ifbr_state]);
else
printf(" ",

Modified: head/sbin/ifconfig/iflagg.c
==
--- head/sbin/ifconfig/iflagg.c Tue Apr 19 04:37:17 2016(r298245)
+++ head/sbin/ifconfig/iflagg.c Tue Apr 19 04:42:34 2016(r298246)
@@ -291,7 +291,7 @@ lagg_status(int s)
 
if (0 /* XXX */) {
printf("\tsupported aggregation protocols:\n");
-   for (i = 0; i < (sizeof(lpr) / sizeof(lpr[0])); i++)
+   for (i = 0; i < nitems(lpr); i++)
printf("\t\tlaggproto %s\n", lpr[i].lpr_name);
}
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298245 - head/sbin/fdisk_pc98

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 04:37:17 2016
New Revision: 298245
URL: https://svnweb.freebsd.org/changeset/base/298245

Log:
  Use nitems() from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/sbin/fdisk_pc98/fdisk.c

Modified: head/sbin/fdisk_pc98/fdisk.c
==
--- head/sbin/fdisk_pc98/fdisk.cTue Apr 19 04:28:25 2016
(r298244)
+++ head/sbin/fdisk_pc98/fdisk.cTue Apr 19 04:37:17 2016
(r298245)
@@ -854,7 +854,7 @@ string(const char *str, char **ans)
 static const char *
 get_type(int type)
 {
-   int numentries = (sizeof(part_types)/sizeof(struct part_type));
+   int numentries = (nitems(part_types));
int counter = 0;
struct  part_type *ptr = part_types;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298244 - head/sbin/dumpon

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 04:28:25 2016
New Revision: 298244
URL: https://svnweb.freebsd.org/changeset/base/298244

Log:
  Use nitems() instead of sizeof(name) / sizeof(*name).
  
  MFC after:2 weeks.

Modified:
  head/sbin/dumpon/dumpon.c

Modified: head/sbin/dumpon/dumpon.c
==
--- head/sbin/dumpon/dumpon.c   Tue Apr 19 03:25:36 2016(r298243)
+++ head/sbin/dumpon/dumpon.c   Tue Apr 19 04:28:25 2016(r298244)
@@ -72,7 +72,7 @@ static void
 check_size(int fd, const char *fn)
 {
int name[] = { CTL_HW, HW_PHYSMEM };
-   size_t namelen = sizeof(name) / sizeof(*name);
+   size_t namelen = nitems(name);
unsigned long physmem;
size_t len;
off_t mediasize;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298204 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings

2016-04-18 Thread Ngie Cooper (yaneurabeya)

> On Apr 18, 2016, at 20:43, Julian Elischer  wrote:
> 
> On 18/04/2016 9:13 PM, Ed Maste wrote:
>> Author: emaste
>> Date: Mon Apr 18 13:13:59 2016
>> New Revision: 298204
>> URL: https://svnweb.freebsd.org/changeset/base/298204
>> 
>> Log:
>>   Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain
> 
> and if the last component is '..' ?
> What our FreeBSD lacks are the $(abspath  ... )  or $(realpath ...)
> operations from gnu make. Actually it lacks a LOT from gnu make.
> I'd love to see us import a lot of things from there that are genuinely 
> useful (and a lot less cryptic).
> 
> 
> you could try make use of :tA in to make this more robust and useful.

Or use SRCTOP, which (by proxy) uses :tA.
Thanks,
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298204 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings

2016-04-18 Thread Julian Elischer

On 18/04/2016 9:13 PM, Ed Maste wrote:

Author: emaste
Date: Mon Apr 18 13:13:59 2016
New Revision: 298204
URL: https://svnweb.freebsd.org/changeset/base/298204

Log:
   Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain


and if the last component is '..' ?
What our FreeBSD lacks are the $(abspath  ... )  or $(realpath ...)
operations from gnu make. Actually it lacks a LOT from gnu make.
I'd love to see us import a lot of things from there that are 
genuinely useful (and a lot less cryptic).



you could try make use of :tA in to make this more robust and useful.

   
   This produces a nicer path in debug info and build logs.
   
   MFC after:	1 week

   Sponsored by:The FreeBSD Foundation

Modified:
   head/lib/libdwarf/Makefile
   head/lib/libelf/Makefile
   head/lib/libelftc/Makefile
   head/usr.bin/addr2line/Makefile
   head/usr.bin/cxxfilt/Makefile
   head/usr.bin/elfcopy/Makefile
   head/usr.bin/nm/Makefile
   head/usr.bin/readelf/Makefile
   head/usr.bin/size/Makefile
   head/usr.bin/strings/Makefile

Modified: head/lib/libdwarf/Makefile
==
--- head/lib/libdwarf/Makefile  Mon Apr 18 11:39:41 2016(r298203)
+++ head/lib/libdwarf/Makefile  Mon Apr 18 13:13:59 2016(r298204)
@@ -2,7 +2,7 @@
  .include 
  
  PACKAGE=lib${LIB}

-TOP=   ${.CURDIR}/../../contrib/elftoolchain
+TOP=   ${.CURDIR:H:H}/contrib/elftoolchain
  SRCDIR=   ${TOP}/libdwarf
  
  .PATH:	${SRCDIR}


Modified: head/lib/libelf/Makefile
==
--- head/lib/libelf/MakefileMon Apr 18 11:39:41 2016(r298203)
+++ head/lib/libelf/MakefileMon Apr 18 13:13:59 2016(r298204)
@@ -5,7 +5,7 @@ SHLIBDIR?= /lib
  
  .include 
  
-TOP=	${.CURDIR}/../../contrib/elftoolchain

+TOP=   ${.CURDIR:H:H}/contrib/elftoolchain
  SRCDIR=   ${TOP}/libelf
  
  .PATH:	${SRCDIR}


Modified: head/lib/libelftc/Makefile
==
--- head/lib/libelftc/Makefile  Mon Apr 18 11:39:41 2016(r298203)
+++ head/lib/libelftc/Makefile  Mon Apr 18 13:13:59 2016(r298204)
@@ -4,7 +4,7 @@
  PACKAGE=lib${LIB}
  INTERNALLIB=
  
-ELFTCDIR=	${.CURDIR}/../../contrib/elftoolchain

+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
  
  .PATH:	${ELFTCDIR}/libelftc
  


Modified: head/usr.bin/addr2line/Makefile
==
--- head/usr.bin/addr2line/Makefile Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/addr2line/Makefile Mon Apr 18 13:13:59 2016
(r298204)
@@ -2,7 +2,7 @@
  
  .include 
  
-ELFTCDIR=	${.CURDIR}/../../contrib/elftoolchain

+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
  ADDR2LINEDIR= ${ELFTCDIR}/addr2line
  
  .PATH: ${ADDR2LINEDIR}


Modified: head/usr.bin/cxxfilt/Makefile
==
--- head/usr.bin/cxxfilt/Makefile   Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/cxxfilt/Makefile   Mon Apr 18 13:13:59 2016
(r298204)
@@ -2,7 +2,7 @@
  
  .include 
  
-ELFTCDIR=	${.CURDIR}/../../contrib/elftoolchain

+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
  SRCDIR=   ${ELFTCDIR}/cxxfilt
  
  .PATH: ${SRCDIR}


Modified: head/usr.bin/elfcopy/Makefile
==
--- head/usr.bin/elfcopy/Makefile   Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/elfcopy/Makefile   Mon Apr 18 13:13:59 2016
(r298204)
@@ -2,7 +2,7 @@
  
  .include 
  
-ELFTCDIR=	${.CURDIR}/../../contrib/elftoolchain

+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
  ELFCOPYDIR=   ${ELFTCDIR}/elfcopy
  
  .PATH: ${ELFCOPYDIR}


Modified: head/usr.bin/nm/Makefile
==
--- head/usr.bin/nm/MakefileMon Apr 18 11:39:41 2016(r298203)
+++ head/usr.bin/nm/MakefileMon Apr 18 13:13:59 2016(r298204)
@@ -2,7 +2,7 @@
  
  .include 
  
-ELFTCDIR=	${.CURDIR}/../../contrib/elftoolchain

+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
  NMDIR=${ELFTCDIR}/nm
  
  .PATH: ${NMDIR}


Modified: head/usr.bin/readelf/Makefile
==
--- head/usr.bin/readelf/Makefile   Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/readelf/Makefile   Mon Apr 18 13:13:59 2016
(r298204)
@@ -1,6 +1,6 @@
  # $FreeBSD$
  
-ELFTCDIR=	${.CURDIR}/../../contrib/elftoolchain

+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
  READELFDIR=   ${ELFTCDIR}/readelf
  
  .PATH: ${READELFDIR}


Modified: head/usr.bin/size/Makefile
==
--- head/usr.bin/size/Makefile  Mon Apr 18 11:39:41 

Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader s

2016-04-18 Thread Devin Teske

> On Apr 18, 2016, at 6:37 PM, Allan Jude  wrote:
> 
> On 2016-04-18 21:32, Devin Teske wrote:
>> 
>>> On Apr 18, 2016, at 6:06 PM, Pedro Giffuni  wrote:
>>> 
>>> 
>>> 
>>> On 04/18/16 19:30, Devin Teske wrote:
 
 
> On Apr 18, 2016, at 4:43 PM, Allan Jude  > wrote:
> 
> On 2016-04-18 19:36, Adrian Chadd wrote:
>> Someone pointed out how this bloats out memory requirement in loader.
>> 
>> Did anyone check that?
>> 
>> -adrian
>> 
> 
> I tested down to 128mb of ram in QEMU, booted from the installer ISO,
> did the install, and booted the installed system without issue.
 
 Hmm. Would be nice if we could claim success under 64MB too.
 If you get the chance.
 How low can it go?
>>> 
>>> FWIW, The code review comments state:
>>> 
>>> 
>>> 
>>> BTW: as mentioned in very beginning of this project, I'm reserving fairly 
>>> large chunk of memory (64MB) for loader and using same amount for both 
>>> BIOS/UEFI variants, default in freebsd is 3MB, eventually this should be 
>>> reviewed, but currently it will affect very small setups.
>>> 
>>> 
>>> 
>>> I still think it's pretty cool, thanks to everyone involved.
>>> 
>> 
>> Does anyone know what the original memory reservation amount was before it 
>> was upped to 64MB?
>> 
> 
> It was 3MB
> 

Next [possibly] dumb question(s).

Is it easily tunable?
If not, why not?
What happens when we want to bump it further in the future?
-- 
Devin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298241 - head/usr.bin/lex

2016-04-18 Thread Pedro Giffuni

No need.. it's done already.. I think.

On 04/18/16 21:39, Marcelo Araujo wrote:

Ok, gonna revert this commit!

Thanks,

On Apr 19, 2016 10:15 AM, "Pedro Giffuni" > wrote:



On 04/18/16 21:05, Marcelo Araujo wrote:

Author: araujo
Date: Tue Apr 19 02:05:32 2016
New Revision: 298241
URL: https://svnweb.freebsd.org/changeset/base/298241

Log:
Use NULL instead of 0 for pointers.

realloc will return NULL in case it cannot allocate memory.

MFC after:   2 weeks.

Modified:
head/usr.bin/lex/initparse.c
head/usr.bin/lex/initscan.c


Hmm ...

These files are computer generated, we have to work out the issues with
upstream (flex).

Cheers,

Pedro.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298241 - head/usr.bin/lex

2016-04-18 Thread Marcelo Araujo
Ok, gonna revert this commit!

Thanks,
On Apr 19, 2016 10:15 AM, "Pedro Giffuni"  wrote:

>
>
> On 04/18/16 21:05, Marcelo Araujo wrote:
>
>> Author: araujo
>> Date: Tue Apr 19 02:05:32 2016
>> New Revision: 298241
>> URL: https://svnweb.freebsd.org/changeset/base/298241
>>
>> Log:
>>Use NULL instead of 0 for pointers.
>>
>>realloc will return NULL in case it cannot allocate memory.
>>
>>MFC after:   2 weeks.
>>
>> Modified:
>>head/usr.bin/lex/initparse.c
>>head/usr.bin/lex/initscan.c
>>
>>
> Hmm ...
>
> These files are computer generated, we have to work out the issues with
> upstream (flex).
>
> Cheers,
>
> Pedro.
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298241 - head/usr.bin/lex

2016-04-18 Thread Pedro Giffuni



On 04/18/16 21:05, Marcelo Araujo wrote:

Author: araujo
Date: Tue Apr 19 02:05:32 2016
New Revision: 298241
URL: https://svnweb.freebsd.org/changeset/base/298241

Log:
   Use NULL instead of 0 for pointers.

   realloc will return NULL in case it cannot allocate memory.

   MFC after:   2 weeks.

Modified:
   head/usr.bin/lex/initparse.c
   head/usr.bin/lex/initscan.c



Hmm ...

These files are computer generated, we have to work out the issues with
upstream (flex).

Cheers,

Pedro.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298242 - head/lib/libstand

2016-04-18 Thread Allan Jude
Author: allanjude
Date: Tue Apr 19 02:06:02 2016
New Revision: 298242
URL: https://svnweb.freebsd.org/changeset/base/298242

Log:
  Unbreak the build if you enable WITH_NAND
  
  Followup to r298230
  
  Submitted by: Nikolai Lifanov  (original version)
  Sponsored by: ScaleEngine Inc.

Modified:
  head/lib/libstand/nandfs.c

Modified: head/lib/libstand/nandfs.c
==
--- head/lib/libstand/nandfs.c  Tue Apr 19 02:05:32 2016(r298241)
+++ head/lib/libstand/nandfs.c  Tue Apr 19 02:06:02 2016(r298242)
@@ -1024,7 +1024,7 @@ ioread(struct open_file *f, off_t pos, v
 
buffer = malloc(nsec * bsize);
 
-   err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos,
+   err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, pos, 0,
nsec * bsize, buffer, NULL);
 
memcpy(buf, (void *)((uintptr_t)buffer + off), length);
@@ -1045,7 +1045,7 @@ nandfs_probe_sectorsize(struct open_file
 
for (i = 512; i < (16 * 1024); i <<= 1) {
NANDFS_DEBUG("%d ", i);
-   err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, i,
+   err = (f->f_dev->dv_strategy)(f->f_devdata, F_READ, 0, 0, i,
buffer, NULL);
 
if (err == 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298241 - head/usr.bin/lex

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 02:05:32 2016
New Revision: 298241
URL: https://svnweb.freebsd.org/changeset/base/298241

Log:
  Use NULL instead of 0 for pointers.
  
  realloc will return NULL in case it cannot allocate memory.
  
  MFC after:2 weeks.

Modified:
  head/usr.bin/lex/initparse.c
  head/usr.bin/lex/initscan.c

Modified: head/usr.bin/lex/initparse.c
==
--- head/usr.bin/lex/initparse.cTue Apr 19 02:00:48 2016
(r298240)
+++ head/usr.bin/lex/initparse.cTue Apr 19 02:05:32 2016
(r298241)
@@ -680,14 +680,14 @@ static int yygrowstack(YYSTACKDATA *data
 
 i = data->s_mark - data->s_base;
 newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
-if (newss == 0)
+if (newss == NULL)
 return -1;
 
 data->s_base = newss;
 data->s_mark = newss + i;
 
 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
-if (newvs == 0)
+if (newvs == NULL)
 return -1;
 
 data->l_base = newvs;
@@ -721,7 +721,7 @@ YYPARSE_DECL()
 #if YYDEBUG
 const char *yys;
 
-if ((yys = getenv("YYDEBUG")) != 0)
+if ((yys = getenv("YYDEBUG")) != NULL)
 {
 yyn = *yys;
 if (yyn >= '0' && yyn <= '9')

Modified: head/usr.bin/lex/initscan.c
==
--- head/usr.bin/lex/initscan.c Tue Apr 19 02:00:48 2016(r298240)
+++ head/usr.bin/lex/initscan.c Tue Apr 19 02:05:32 2016(r298241)
@@ -3455,7 +3455,7 @@ YY_RULE_SETUP
 }
 nmstr[yyleng - 2 - end_is_ws] = '\0';  /* chop trailing brace */
 
-   if ( (nmdefptr = ndlookup( nmstr )) == 0 )
+   if ( (nmdefptr = ndlookup( nmstr )) == NULL )
format_synerr(
_( "undefined definition {%s}" ),
nmstr );
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298240 - head/sbin/restore

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 02:00:48 2016
New Revision: 298240
URL: https://svnweb.freebsd.org/changeset/base/298240

Log:
  malloc will return NULL if it cannot allocate memory.
  
  MFC after:2 weeks.

Modified:
  head/sbin/restore/dirs.c

Modified: head/sbin/restore/dirs.c
==
--- head/sbin/restore/dirs.cTue Apr 19 01:59:26 2016(r298239)
+++ head/sbin/restore/dirs.cTue Apr 19 02:00:48 2016(r298240)
@@ -598,7 +598,7 @@ setdirmodes(int flags)
if (bufsize < node.extsize) {
if (bufsize > 0)
free(buf);
-   if ((buf = malloc(node.extsize)) != 0) {
+   if ((buf = malloc(node.extsize)) != NULL) {
bufsize = node.extsize;
} else {
bufsize = 0;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298239 - head/sbin/quotacheck

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 01:59:26 2016
New Revision: 298239
URL: https://svnweb.freebsd.org/changeset/base/298239

Log:
  getfsent(3) will return NULL on EOF or error.
  
  MFC after:2 weeks.

Modified:
  head/sbin/quotacheck/preen.c

Modified: head/sbin/quotacheck/preen.c
==
--- head/sbin/quotacheck/preen.cTue Apr 19 01:57:56 2016
(r298238)
+++ head/sbin/quotacheck/preen.cTue Apr 19 01:59:26 2016
(r298239)
@@ -105,7 +105,7 @@ checkfstab(int uflag, int gflag)
warnx("Can't open checklist file: %s\n", _PATH_FSTAB);
return (8);
}
-   while ((fs = getfsent()) != 0) {
+   while ((fs = getfsent()) != NULL) {
if (fs->fs_passno > passno && fs->fs_passno < nextpass)
nextpass = fs->fs_passno;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298238 - head/sbin/ping6

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 01:57:56 2016
New Revision: 298238
URL: https://svnweb.freebsd.org/changeset/base/298238

Log:
  Use NULL instead of 0 for pointers.
  
  malloc will return NULL if it cannot allocate memory.
  
  MFC after:2 weeks.

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==
--- head/sbin/ping6/ping6.c Tue Apr 19 01:48:18 2016(r298237)
+++ head/sbin/ping6/ping6.c Tue Apr 19 01:57:56 2016(r298238)
@@ -863,7 +863,7 @@ main(int argc, char *argv[])
 
/* set IP6 packet options */
if (ip6optlen) {
-   if ((scmsg = (char *)malloc(ip6optlen)) == 0)
+   if ((scmsg = (char *)malloc(ip6optlen)) == NULL)
errx(1, "can't allocate enough memory");
smsghdr.msg_control = (caddr_t)scmsg;
smsghdr.msg_controllen = ip6optlen;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298237 - in head/sys: dev/dpaa powerpc/booke powerpc/include powerpc/mpc85xx powerpc/powerpc

2016-04-18 Thread Justin Hibbits
Author: jhibbits
Date: Tue Apr 19 01:48:18 2016
New Revision: 298237
URL: https://svnweb.freebsd.org/changeset/base/298237

Log:
  Fix SMP booting for PowerPC Book-E
  
  Summary:
  PowerPC Book-E SMP is currently broken for unknown reasons.  Pull in
  Semihalf changes made c2012 for e500mc/e5500, which enables booting SMP.
  
  This eliminates the shared software TLB1 table, replacing it with
  tlb1_read_entry() function.
  
  This does not yet support ePAPR SMP booting, and doesn't handle resetting CPUs
  already released (ePAPR boot releases APs to a spin loop waiting on a specific
  address).  This will be addressed in the near future by using the MPIC to 
reset
  the AP into our own alternate boot address.
  
  This does include a change to the dpaa/dtsec(4) driver, to mark the portals as
  CPU-private.
  
  Test Plan:
  Tested on Amiga X5000/20 (P5020).  Boots, prints the following
  messages:
  
   Adding CPU 0, pir=0, awake=1
   Waking up CPU 1 (dev=1)
   Adding CPU 1, pir=20, awake=1
   SMP: AP CPU #1 launched
  
  top(1) shows CPU1 active.
  
  Obtained from:Semihalf
  Relnotes: Yes
  Differential Revision: https://reviews.freebsd.org/D5945

Modified:
  head/sys/dev/dpaa/portals_common.c
  head/sys/powerpc/booke/locore.S
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/include/tlb.h
  head/sys/powerpc/mpc85xx/platform_mpc85xx.c
  head/sys/powerpc/powerpc/genassym.c
  head/sys/powerpc/powerpc/mp_machdep.c

Modified: head/sys/dev/dpaa/portals_common.c
==
--- head/sys/dev/dpaa/portals_common.c  Tue Apr 19 01:25:35 2016
(r298236)
+++ head/sys/dev/dpaa/portals_common.c  Tue Apr 19 01:48:18 2016
(r298237)
@@ -75,8 +75,6 @@ dpaa_portal_alloc_res(device_t dev, stru
sc->sc_rres[0] = bus_alloc_resource(dev,
SYS_RES_MEMORY, >sc_rrid[0], rle->start + sc->sc_dp_pa,
rle->end + sc->sc_dp_pa, rle->count, RF_ACTIVE);
-   
pmap_change_attr((vm_offset_t)rman_get_bushandle(sc->sc_rres[0]),
-   rle->count, VM_MEMATTR_CACHEABLE);
if (sc->sc_rres[0] == NULL) {
device_printf(dev, "Could not allocate memory.\n");
return (ENXIO);

Modified: head/sys/powerpc/booke/locore.S
==
--- head/sys/powerpc/booke/locore.S Tue Apr 19 01:25:35 2016
(r298236)
+++ head/sys/powerpc/booke/locore.S Tue Apr 19 01:48:18 2016
(r298237)
@@ -104,6 +104,10 @@ __start:
mtmsr   %r3
isync
 
+/*
+ * Initial HIDs configuration
+ */
+1:
mfpvr   %r3
rlwinm  %r3, %r3, 16, 16, 31
 
@@ -161,7 +165,6 @@ __start:
 /*
  * Create temporary mapping in AS=1 and switch to it
  */
-   addi%r3, %r29, 1
bl  tlb1_temp_mapping_as1
 
mfmsr   %r3
@@ -197,7 +200,7 @@ __start:
lis %r3, KERNBASE@h
ori %r3, %r3, KERNBASE@l/* EPN = KERNBASE */
 #ifdef SMP
-   ori %r3, %r3, MAS2_M@l  /* WIMGE = 0b00100 */
+   ori %r3, %r3, (_TLB_ENTRY_SHARED | MAS2_M)@l /* WIMGE = 0b00100 */
 #endif
mtspr   SPR_MAS2, %r3
isync
@@ -295,21 +298,19 @@ done_mapping:
 __boot_page:
bl  1f
 
-   .globl  bp_ntlb1s
-bp_ntlb1s:
+   .globl  bp_trace
+bp_trace:
.long   0
 
-   .globl  bp_tlb1
-bp_tlb1:
-   .space  4 * 3 * 64
-
-   .globl  bp_tlb1_end
-bp_tlb1_end:
+   .globl  bp_kernload
+bp_kernload:
+   .long   0
 
 /*
  * Initial configuration
  */
-1: mflr%r31/* r31 hold the address of bp_ntlb1s */
+1:
+   mflr%r31/* r31 hold the address of bp_trace */
 
/* Set HIDs */
mfpvr   %r3
@@ -332,20 +333,7 @@ bp_tlb1_end:
 3:
mtspr   SPR_HID0, %r4
isync
-/*
- * E500mc and E5500 do not have HID1 register, so skip HID1 setup on
- * this core.
- */
-   cmpli   0, 0, %r3, FSL_E500mc
-   beq 1f
-   cmpli   0, 0, %r3, FSL_E5500
-   beq 1f
 
-   lis %r3, HID1_E500_DEFAULT_SET@h
-   ori %r3, %r3, HID1_E500_DEFAULT_SET@l
-   mtspr   SPR_HID1, %r3
-   isync
-1:
/* Enable branch prediction */
li  %r3, BUCSR_BPEN
mtspr   SPR_BUCSR, %r3
@@ -367,7 +355,7 @@ bp_tlb1_end:
 /*
  * Create temporary translation in AS=1 and switch to it
  */
-   lwz %r3, 0(%r31)
+
bl  tlb1_temp_mapping_as1
 
mfmsr   %r3
@@ -388,39 +376,46 @@ bp_tlb1_end:
 /*
  * Setup final mapping in TLB1[1] and switch to it
  */
-   lwz %r6, 0(%r31)
-   addi%r5, %r31, 4
-   li  %r4, 0
-
-4: lis %r3, MAS0_TLBSEL1@h
-   rlwimi  %r3, %r4, 16, 12, 15
+   /* Final kernel mapping, map in 64 MB of RAM */
+   lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */
+   li  %r4, 0  /* Entry 0 */
+   rlwimi  %r3, 

Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader s

2016-04-18 Thread Allan Jude
On 2016-04-18 21:32, Devin Teske wrote:
> 
>> On Apr 18, 2016, at 6:06 PM, Pedro Giffuni  wrote:
>>
>>
>>
>> On 04/18/16 19:30, Devin Teske wrote:
>>>
>>>
 On Apr 18, 2016, at 4:43 PM, Allan Jude > wrote:

 On 2016-04-18 19:36, Adrian Chadd wrote:
> Someone pointed out how this bloats out memory requirement in loader.
>
> Did anyone check that?
>
> -adrian
>

 I tested down to 128mb of ram in QEMU, booted from the installer ISO,
 did the install, and booted the installed system without issue.
>>>
>>> Hmm. Would be nice if we could claim success under 64MB too.
>>> If you get the chance.
>>> How low can it go?
>>
>> FWIW, The code review comments state:
>>
>> 
>>
>> BTW: as mentioned in very beginning of this project, I'm reserving fairly 
>> large chunk of memory (64MB) for loader and using same amount for both 
>> BIOS/UEFI variants, default in freebsd is 3MB, eventually this should be 
>> reviewed, but currently it will affect very small setups.
>>
>> 
>>
>> I still think it's pretty cool, thanks to everyone involved.
>>
> 
> Does anyone know what the original memory reservation amount was before it 
> was upped to 64MB?
> 

It was 3MB

-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader s

2016-04-18 Thread Devin Teske

> On Apr 18, 2016, at 6:06 PM, Pedro Giffuni  wrote:
> 
> 
> 
> On 04/18/16 19:30, Devin Teske wrote:
>> 
>> 
>>> On Apr 18, 2016, at 4:43 PM, Allan Jude >> > wrote:
>>> 
>>> On 2016-04-18 19:36, Adrian Chadd wrote:
 Someone pointed out how this bloats out memory requirement in loader.
 
 Did anyone check that?
 
 -adrian
 
>>> 
>>> I tested down to 128mb of ram in QEMU, booted from the installer ISO,
>>> did the install, and booted the installed system without issue.
>> 
>> Hmm. Would be nice if we could claim success under 64MB too.
>> If you get the chance.
>> How low can it go?
> 
> FWIW, The code review comments state:
> 
> 
> 
> BTW: as mentioned in very beginning of this project, I'm reserving fairly 
> large chunk of memory (64MB) for loader and using same amount for both 
> BIOS/UEFI variants, default in freebsd is 3MB, eventually this should be 
> reviewed, but currently it will affect very small setups.
> 
> 
> 
> I still think it's pretty cool, thanks to everyone involved.
> 

Does anyone know what the original memory reservation amount was before it was 
upped to 64MB?
-- 
Devin

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298236 - head/sbin/init

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 01:25:35 2016
New Revision: 298236
URL: https://svnweb.freebsd.org/changeset/base/298236

Log:
  Use NULL instead of 0 for pointers.
  
  dbopen(3) will returns a NULL on error.
  
  MFC after:2 weeks.

Modified:
  head/sbin/init/init.c

Modified: head/sbin/init/init.c
==
--- head/sbin/init/init.c   Tue Apr 19 01:01:22 2016(r298235)
+++ head/sbin/init/init.c   Tue Apr 19 01:25:35 2016(r298236)
@@ -1144,7 +1144,7 @@ start_session_db(void)
 {
if (session_db && (*session_db->close)(session_db))
emergency("session database close: %s", strerror(errno));
-   if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == 0) {
+   if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == NULL) {
emergency("session database open: %s", strerror(errno));
return (1);
}
@@ -1284,7 +1284,7 @@ new_session(session_t *sprev, struct tty
}
 
sp->se_next = 0;
-   if (sprev == 0) {
+   if (sprev == NULL) {
sessions = sp;
sp->se_prev = 0;
} else {
@@ -1311,7 +1311,7 @@ setupargv(session_t *sp, struct ttyent *
sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name);
sp->se_getty_argv_space = strdup(sp->se_getty);
sp->se_getty_argv = construct_argv(sp->se_getty_argv_space);
-   if (sp->se_getty_argv == 0) {
+   if (sp->se_getty_argv == NULL) {
warning("can't parse getty for port %s", sp->se_device);
free(sp->se_getty);
free(sp->se_getty_argv_space);
@@ -1329,7 +1329,7 @@ setupargv(session_t *sp, struct ttyent *
sp->se_window = strdup(typ->ty_window);
sp->se_window_argv_space = strdup(sp->se_window);
sp->se_window_argv = construct_argv(sp->se_window_argv_space);
-   if (sp->se_window_argv == 0) {
+   if (sp->se_window_argv == NULL) {
warning("can't parse window for port %s",
sp->se_device);
free(sp->se_window_argv_space);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader s

2016-04-18 Thread Pedro Giffuni



On 04/18/16 19:30, Devin Teske wrote:




On Apr 18, 2016, at 4:43 PM, Allan Jude > wrote:

On 2016-04-18 19:36, Adrian Chadd wrote:

Someone pointed out how this bloats out memory requirement in loader.

Did anyone check that?

-adrian



I tested down to 128mb of ram in QEMU, booted from the installer ISO,
did the install, and booted the installed system without issue.


Hmm. Would be nice if we could claim success under 64MB too.
If you get the chance.
How low can it go?


FWIW, The code review comments state:



BTW: as mentioned in very beginning of this project, I'm reserving 
fairly large chunk of memory (64MB) for loader and using same amount for 
both BIOS/UEFI variants, default in freebsd is 3MB, eventually this 
should be reviewed, but currently it will affect very small setups.




I still think it's pretty cool, thanks to everyone involved.

Cheers,

Pedro.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298235 - head/sbin/dump

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 01:01:22 2016
New Revision: 298235
URL: https://svnweb.freebsd.org/changeset/base/298235

Log:
  Use NULL instead of 0.
  
  malloc will return NULL in case it cannot allocate memory.
  
  MFC after:2 weeks.

Modified:
  head/sbin/dump/traverse.c

Modified: head/sbin/dump/traverse.c
==
--- head/sbin/dump/traverse.c   Tue Apr 19 00:59:15 2016(r298234)
+++ head/sbin/dump/traverse.c   Tue Apr 19 01:01:22 2016(r298235)
@@ -928,7 +928,7 @@ loop:
if (cnt == size)
return;
} else {
-   if (tmpbuf == NULL && (tmpbuf = malloc(secsize)) == 0)
+   if (tmpbuf == NULL && (tmpbuf = malloc(secsize)) == NULL)
quit("buffer malloc failed\n");
xfer = 0;
bytes = size;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298234 - head/sbin/atm/atmconfig

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 00:59:15 2016
New Revision: 298234
URL: https://svnweb.freebsd.org/changeset/base/298234

Log:
  Use NULL for pointers instead of 0.
  
  MFC after:2 weeks.

Modified:
  head/sbin/atm/atmconfig/natm.c

Modified: head/sbin/atm/atmconfig/natm.c
==
--- head/sbin/atm/atmconfig/natm.c  Tue Apr 19 00:40:43 2016
(r298233)
+++ head/sbin/atm/atmconfig/natm.c  Tue Apr 19 00:59:15 2016
(r298234)
@@ -575,7 +575,7 @@ natm_delete(int argc, char *argv[])
TAILQ_FOREACH(aif, _list, link)
if (strcmp(aif->ifname, argv[0]) == 0)
break;
-   if (aif == 0)
+   if (aif == NULL)
errx(1, "no such interface '%s'", argv[0]);
 
vpi = parse_num(argv[1], "VPI", 0xff);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298233 - head/bin/ps

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 00:40:43 2016
New Revision: 298233
URL: https://svnweb.freebsd.org/changeset/base/298233

Log:
  Use NULL instead of 0 for pointers.
  
  kvm_open(3) will return NULL when it cannot access kernel virtual memory.
  
  MFC after:2 weeks.

Modified:
  head/bin/ps/ps.c

Modified: head/bin/ps/ps.c
==
--- head/bin/ps/ps.cTue Apr 19 00:38:07 2016(r298232)
+++ head/bin/ps/ps.cTue Apr 19 00:40:43 2016(r298233)
@@ -451,7 +451,7 @@ main(int argc, char *argv[])
xkeep = xkeep_implied;
 
kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
-   if (kd == 0)
+   if (kd == NULL)
xo_errx(1, "%s", errbuf);
 
if (!_fmt)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298232 - head/bin/test

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Tue Apr 19 00:38:07 2016
New Revision: 298232
URL: https://svnweb.freebsd.org/changeset/base/298232

Log:
  Use NULL for pointers instead of 0.
  
  MFC after:2 weeks.

Modified:
  head/bin/test/test.c

Modified: head/bin/test/test.c
==
--- head/bin/test/test.cMon Apr 18 23:26:11 2016(r298231)
+++ head/bin/test/test.cTue Apr 19 00:38:07 2016(r298232)
@@ -465,7 +465,7 @@ t_lex(char *s)
 {
int num;
 
-   if (s == 0) {
+   if (s == NULL) {
return EOI;
}
num = find_op(s);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader s

2016-04-18 Thread Devin Teske


> On Apr 18, 2016, at 4:43 PM, Allan Jude  wrote:
> 
> On 2016-04-18 19:36, Adrian Chadd wrote:
>> Someone pointed out how this bloats out memory requirement in loader.
>> 
>> Did anyone check that?
>> 
>> -adrian
>> 
> 
> I tested down to 128mb of ram in QEMU, booted from the installer ISO, did the 
> install, and booted the installed system without issue.

Hmm. Would be nice if we could claim success under 64MB too.
If you get the chance.
How low can it go?
-- 
Devin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader s

2016-04-18 Thread Allan Jude

On 2016-04-18 19:36, Adrian Chadd wrote:

Someone pointed out how this bloats out memory requirement in loader.

Did anyone check that?

-adrian



I tested down to 128mb of ram in QEMU, booted from the installer ISO, 
did the install, and booted the installed system without issue.





On 18 April 2016 at 16:09, Allan Jude  wrote:

Author: allanjude
Date: Mon Apr 18 23:09:22 2016
New Revision: 298230
URL: https://svnweb.freebsd.org/changeset/base/298230

Log:
   A new implementation of the loader block cache

   The block cache implementation in loader has proven to be almost useless, 
and in worst case even slowing down the disk reads due to insufficient cache 
size and extra memory copy.
   Also the current cache implementation does not cache reads from CDs, or work 
with zfs built on top of multiple disks.
   Instead of an LRU, this code uses a simple hash (O(1) read from cache), and 
instead of a single global cache, a separate cache per block device.
   The cache also implements limited read-ahead to increase performance.
   To simplify read ahead management, the read ahead will not wrap over bcache 
end, so in worst case, single block physical read will be performed to fill the 
last block in bcache.

   Booting from a virtual CD over IPMI:
   0ms latency, before: 27 second, after: 7 seconds
   60ms latency, before: over 12 minutes, after: under 5 minutes.

   Submitted by: Toomas Soome 
   Reviewed by:  delphij (previous version), emaste (previous version)
   Relnotes: yes
   Differential Revision:https://reviews.freebsd.org/D4713




--
Allan Jude
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader s

2016-04-18 Thread Adrian Chadd
Someone pointed out how this bloats out memory requirement in loader.

Did anyone check that?



-adrian


On 18 April 2016 at 16:09, Allan Jude  wrote:
> Author: allanjude
> Date: Mon Apr 18 23:09:22 2016
> New Revision: 298230
> URL: https://svnweb.freebsd.org/changeset/base/298230
>
> Log:
>   A new implementation of the loader block cache
>
>   The block cache implementation in loader has proven to be almost useless, 
> and in worst case even slowing down the disk reads due to insufficient cache 
> size and extra memory copy.
>   Also the current cache implementation does not cache reads from CDs, or 
> work with zfs built on top of multiple disks.
>   Instead of an LRU, this code uses a simple hash (O(1) read from cache), and 
> instead of a single global cache, a separate cache per block device.
>   The cache also implements limited read-ahead to increase performance.
>   To simplify read ahead management, the read ahead will not wrap over bcache 
> end, so in worst case, single block physical read will be performed to fill 
> the last block in bcache.
>
>   Booting from a virtual CD over IPMI:
>   0ms latency, before: 27 second, after: 7 seconds
>   60ms latency, before: over 12 minutes, after: under 5 minutes.
>
>   Submitted by: Toomas Soome 
>   Reviewed by:  delphij (previous version), emaste (previous version)
>   Relnotes: yes
>   Differential Revision:https://reviews.freebsd.org/D4713
>
> Modified:
>   head/lib/libstand/cd9660.c
>   head/lib/libstand/dosfs.c
>   head/lib/libstand/dosfs.h
>   head/lib/libstand/ext2fs.c
>   head/lib/libstand/read.c
>   head/lib/libstand/stand.h
>   head/lib/libstand/ufs.c
>   head/lib/libstand/write.c
>   head/sys/boot/common/bcache.c
>   head/sys/boot/common/bootstrap.h
>   head/sys/boot/common/disk.c
>   head/sys/boot/common/md.c
>   head/sys/boot/common/module.c
>   head/sys/boot/efi/libefi/efipart.c
>   head/sys/boot/efi/libefi/libefi.c
>   head/sys/boot/efi/loader/main.c
>   head/sys/boot/i386/libfirewire/firewire.c
>   head/sys/boot/i386/libi386/bioscd.c
>   head/sys/boot/i386/libi386/biosdisk.c
>   head/sys/boot/i386/libi386/biosmem.c
>   head/sys/boot/i386/libi386/pxe.c
>   head/sys/boot/i386/loader/main.c
>   head/sys/boot/mips/beri/loader/beri_disk_cfi.c
>   head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
>   head/sys/boot/ofw/libofw/ofw_disk.c
>   head/sys/boot/pc98/libpc98/bioscd.c
>   head/sys/boot/pc98/libpc98/biosdisk.c
>   head/sys/boot/pc98/libpc98/biosmem.c
>   head/sys/boot/pc98/loader/main.c
>   head/sys/boot/powerpc/kboot/hostdisk.c
>   head/sys/boot/powerpc/ps3/ps3cdrom.c
>   head/sys/boot/powerpc/ps3/ps3disk.c
>   head/sys/boot/uboot/lib/disk.c
>   head/sys/boot/usb/storage/umass_loader.c
>   head/sys/boot/userboot/userboot/host.c
>   head/sys/boot/userboot/userboot/main.c
>   head/sys/boot/userboot/userboot/userboot_disk.c
>   head/sys/boot/zfs/zfs.c
>
> Modified: head/lib/libstand/cd9660.c
> ==
> --- head/lib/libstand/cd9660.c  Mon Apr 18 22:00:26 2016(r298229)
> +++ head/lib/libstand/cd9660.c  Mon Apr 18 23:09:22 2016(r298230)
> @@ -143,7 +143,7 @@ susp_lookup_record(struct open_file *f,
> if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) {
> shc = (ISO_RRIP_CONT *)sh;
> error = f->f_dev->dv_strategy(f->f_devdata, F_READ,
> -   cdb2devb(isonum_733(shc->location)),
> +   cdb2devb(isonum_733(shc->location)), 0,
> ISO_DEFAULT_BLOCK_SIZE, susp_buffer, );
>
> /* Bail if it fails. */
> @@ -288,7 +288,7 @@ cd9660_open(const char *path, struct ope
> for (bno = 16;; bno++) {
> twiddle(1);
> rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, 
> cdb2devb(bno),
> -  ISO_DEFAULT_BLOCK_SIZE, buf, 
> );
> +   0, ISO_DEFAULT_BLOCK_SIZE, buf, 
> );
> if (rc)
> goto out;
> if (read != ISO_DEFAULT_BLOCK_SIZE) {
> @@ -322,7 +322,7 @@ cd9660_open(const char *path, struct ope
> twiddle(1);
> rc = f->f_dev->dv_strategy
> (f->f_devdata, F_READ,
> -cdb2devb(bno + boff),
> +cdb2devb(bno + boff), 0,
>  ISO_DEFAULT_BLOCK_SIZE,
>  buf, );
> if (rc)
> @@ -381,7 +381,7 @@ cd9660_open(const char *path, struct ope
> bno = isonum_733(rec.extent) + 
> isonum_711(rec.ext_attr_length);
> twiddle(1);
> rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, 
> cdb2devb(bno),

svn commit: r298230 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/mips/beri/loader sy...

2016-04-18 Thread Allan Jude
Author: allanjude
Date: Mon Apr 18 23:09:22 2016
New Revision: 298230
URL: https://svnweb.freebsd.org/changeset/base/298230

Log:
  A new implementation of the loader block cache
  
  The block cache implementation in loader has proven to be almost useless, and 
in worst case even slowing down the disk reads due to insufficient cache size 
and extra memory copy.
  Also the current cache implementation does not cache reads from CDs, or work 
with zfs built on top of multiple disks.
  Instead of an LRU, this code uses a simple hash (O(1) read from cache), and 
instead of a single global cache, a separate cache per block device.
  The cache also implements limited read-ahead to increase performance.
  To simplify read ahead management, the read ahead will not wrap over bcache 
end, so in worst case, single block physical read will be performed to fill the 
last block in bcache.
  
  Booting from a virtual CD over IPMI:
  0ms latency, before: 27 second, after: 7 seconds
  60ms latency, before: over 12 minutes, after: under 5 minutes.
  
  Submitted by: Toomas Soome 
  Reviewed by:  delphij (previous version), emaste (previous version)
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D4713

Modified:
  head/lib/libstand/cd9660.c
  head/lib/libstand/dosfs.c
  head/lib/libstand/dosfs.h
  head/lib/libstand/ext2fs.c
  head/lib/libstand/read.c
  head/lib/libstand/stand.h
  head/lib/libstand/ufs.c
  head/lib/libstand/write.c
  head/sys/boot/common/bcache.c
  head/sys/boot/common/bootstrap.h
  head/sys/boot/common/disk.c
  head/sys/boot/common/md.c
  head/sys/boot/common/module.c
  head/sys/boot/efi/libefi/efipart.c
  head/sys/boot/efi/libefi/libefi.c
  head/sys/boot/efi/loader/main.c
  head/sys/boot/i386/libfirewire/firewire.c
  head/sys/boot/i386/libi386/bioscd.c
  head/sys/boot/i386/libi386/biosdisk.c
  head/sys/boot/i386/libi386/biosmem.c
  head/sys/boot/i386/libi386/pxe.c
  head/sys/boot/i386/loader/main.c
  head/sys/boot/mips/beri/loader/beri_disk_cfi.c
  head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
  head/sys/boot/ofw/libofw/ofw_disk.c
  head/sys/boot/pc98/libpc98/bioscd.c
  head/sys/boot/pc98/libpc98/biosdisk.c
  head/sys/boot/pc98/libpc98/biosmem.c
  head/sys/boot/pc98/loader/main.c
  head/sys/boot/powerpc/kboot/hostdisk.c
  head/sys/boot/powerpc/ps3/ps3cdrom.c
  head/sys/boot/powerpc/ps3/ps3disk.c
  head/sys/boot/uboot/lib/disk.c
  head/sys/boot/usb/storage/umass_loader.c
  head/sys/boot/userboot/userboot/host.c
  head/sys/boot/userboot/userboot/main.c
  head/sys/boot/userboot/userboot/userboot_disk.c
  head/sys/boot/zfs/zfs.c

Modified: head/lib/libstand/cd9660.c
==
--- head/lib/libstand/cd9660.c  Mon Apr 18 22:00:26 2016(r298229)
+++ head/lib/libstand/cd9660.c  Mon Apr 18 23:09:22 2016(r298230)
@@ -143,7 +143,7 @@ susp_lookup_record(struct open_file *f, 
if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) {
shc = (ISO_RRIP_CONT *)sh;
error = f->f_dev->dv_strategy(f->f_devdata, F_READ,
-   cdb2devb(isonum_733(shc->location)),
+   cdb2devb(isonum_733(shc->location)), 0,
ISO_DEFAULT_BLOCK_SIZE, susp_buffer, );
 
/* Bail if it fails. */
@@ -288,7 +288,7 @@ cd9660_open(const char *path, struct ope
for (bno = 16;; bno++) {
twiddle(1);
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno),
-  ISO_DEFAULT_BLOCK_SIZE, buf, );
+   0, ISO_DEFAULT_BLOCK_SIZE, buf, );
if (rc)
goto out;
if (read != ISO_DEFAULT_BLOCK_SIZE) {
@@ -322,7 +322,7 @@ cd9660_open(const char *path, struct ope
twiddle(1);
rc = f->f_dev->dv_strategy
(f->f_devdata, F_READ,
-cdb2devb(bno + boff),
+cdb2devb(bno + boff), 0,
 ISO_DEFAULT_BLOCK_SIZE,
 buf, );
if (rc)
@@ -381,7 +381,7 @@ cd9660_open(const char *path, struct ope
bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length);
twiddle(1);
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ, cdb2devb(bno),
-   ISO_DEFAULT_BLOCK_SIZE, buf, );
+   0, ISO_DEFAULT_BLOCK_SIZE, buf, );
if (rc)
goto out;
if (read != ISO_DEFAULT_BLOCK_SIZE) {
@@ -438,7 +438,8 @@ buf_read_file(struct open_file *f, char 
 
twiddle(16);
rc = f->f_dev->dv_strategy(f->f_devdata, F_READ,
-

svn commit: r298231 - head/sys/dev/hptmv

2016-04-18 Thread Sean Bruno
Author: sbruno
Date: Mon Apr 18 23:26:11 2016
New Revision: 298231
URL: https://svnweb.freebsd.org/changeset/base/298231

Log:
  hptmv(4) Fix potential buffer overflow in hpt_set_info.
  
  While here, adjust some whitespace and yeild some useful debug info.
  
  This is untested on this hardware, testing requests to -scsi went
  unanswered.
  
  PR:   206585
  Submitted by: ct...@hardenedbsd.org
  MFC after:2 weeks

Modified:
  head/sys/dev/hptmv/hptproc.c

Modified: head/sys/dev/hptmv/hptproc.c
==
--- head/sys/dev/hptmv/hptproc.cMon Apr 18 23:09:22 2016
(r298230)
+++ head/sys/dev/hptmv/hptproc.cMon Apr 18 23:26:11 2016
(r298231)
@@ -308,7 +308,9 @@ hpt_set_info(int length)
/*
 * map buffer to kernel.
 */
-   if (piop->nInBufferSize+piop->nOutBufferSize > 
PAGE_SIZE) {
+   if (piop->nInBufferSize > PAGE_SIZE ||
+   piop->nOutBufferSize > PAGE_SIZE ||
+   piop->nInBufferSize+piop->nOutBufferSize > 
PAGE_SIZE) {
KdPrintE(("User buffer too large\n"));
return -EINVAL;
}
@@ -319,8 +321,13 @@ hpt_set_info(int length)
return -EINVAL;
}
 
-   if (piop->nInBufferSize)
-   copyin((void*)(ULONG_PTR)piop->lpInBuffer, 
ke_area, piop->nInBufferSize);
+   if (piop->nInBufferSize) {
+   if (copyin((void*)(ULONG_PTR)piop->lpInBuffer, 
ke_area, piop->nInBufferSize) != 0) {
+   KdPrintE(("Failed to copyin from 
lpInBuffer\n"));
+   free(ke_area, M_DEVBUF);
+   return -EFAULT;
+   }
+   }
 
/*
  * call kernel handler.
@@ -342,7 +349,7 @@ hpt_set_info(int length)
else  KdPrintW(("Kernel_ioctl(): return %d\n", err));
 
free(ke_area, M_DEVBUF);
-   return -EINVAL;
+   return -EINVAL;
} else  {
KdPrintW(("Wrong signature: %x\n", piop->Magic));
return -EINVAL;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298229 - head/share/mk

2016-04-18 Thread Simon J. Gerraty
Author: sjg
Date: Mon Apr 18 22:00:26 2016
New Revision: 298229
URL: https://svnweb.freebsd.org/changeset/base/298229

Log:
  Allow -f dirdeps.mk some/dir with no TARGET_MACHINE spec
  
  Use $MACHINE if target does not specify.
  
  Reviewed by:  bdrewery

Modified:
  head/share/mk/dirdeps.mk

Modified: head/share/mk/dirdeps.mk
==
--- head/share/mk/dirdeps.mkMon Apr 18 21:11:55 2016(r298228)
+++ head/share/mk/dirdeps.mkMon Apr 18 22:00:26 2016(r298229)
@@ -135,6 +135,9 @@ DIRDEPS := ${.TARGETS:M*[/.]*}
 DEP_RELDIR := ${DIRDEPS:[1]:R}
 # this will become DEP_MACHINE below
 TARGET_MACHINE := ${DIRDEPS:[1]:E:C/,.*//}
+.if ${TARGET_MACHINE:N*/*} == ""
+TARGET_MACHINE := ${MACHINE}
+.endif
 # disable DIRDEPS_CACHE as it does not like this trick
 MK_DIRDEPS_CACHE = no
 .endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298228 - head/share/mk

2016-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Mon Apr 18 21:11:55 2016
New Revision: 298228
URL: https://svnweb.freebsd.org/changeset/base/298228

Log:
  META_MODE: Don't hide the .depend rm -f command.
  
  Otherwise the build command changes every build.  META_MODE will
  only remove it if something changes to warrant rebuilding
  the file.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkMon Apr 18 21:05:19 2016(r298227)
+++ head/share/mk/bsd.dep.mkMon Apr 18 21:11:55 2016(r298228)
@@ -238,7 +238,7 @@ DPSRCS+= ${SRCS}
 # beforedepend/_EXTRADEPEND/afterdepend.  The target is kept
 # to allow 'make depend' to generate files.
 ${DEPENDFILE}: ${DPSRCS}
-.if exists(${.OBJDIR}/${DEPENDFILE})
+.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE})
rm -f ${DEPENDFILE}
 .endif
 .if target(_EXTRADEPEND)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298226 - in head/lib/libc: db/btree gen inet isc net resolv rpc secure stdlib xdr yp

2016-04-18 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Apr 18 21:05:15 2016
New Revision: 298226
URL: https://svnweb.freebsd.org/changeset/base/298226

Log:
  libc: do not include  where  was already included
  
  According to style(9):
  > normally, include  OR , but not both.
  ( already includes  when LOCORE is not defined).

Modified:
  head/lib/libc/db/btree/bt_split.c
  head/lib/libc/gen/arc4random.c
  head/lib/libc/gen/devname.c
  head/lib/libc/gen/exec.c
  head/lib/libc/gen/getnetgrent.c
  head/lib/libc/gen/setproctitle.c
  head/lib/libc/inet/inet_addr.c
  head/lib/libc/inet/inet_ntop.c
  head/lib/libc/inet/inet_pton.c
  head/lib/libc/inet/nsap_addr.c
  head/lib/libc/isc/eventlib_p.h
  head/lib/libc/net/base64.c
  head/lib/libc/net/ether_addr.c
  head/lib/libc/net/eui64.c
  head/lib/libc/net/getaddrinfo.c
  head/lib/libc/net/gethostbydns.c
  head/lib/libc/net/getprotoent.c
  head/lib/libc/net/getservent.c
  head/lib/libc/net/hesiod.c
  head/lib/libc/net/ip6opt.c
  head/lib/libc/net/map_v4v6.c
  head/lib/libc/net/rthdr.c
  head/lib/libc/net/sourcefilter.c
  head/lib/libc/resolv/herror.c
  head/lib/libc/resolv/res_comp.c
  head/lib/libc/resolv/res_data.c
  head/lib/libc/resolv/res_debug.c
  head/lib/libc/resolv/res_init.c
  head/lib/libc/resolv/res_mkquery.c
  head/lib/libc/resolv/res_mkupdate.c
  head/lib/libc/resolv/res_query.c
  head/lib/libc/resolv/res_send.c
  head/lib/libc/rpc/getrpcent.c
  head/lib/libc/rpc/rpc_generic.c
  head/lib/libc/rpc/svc_vc.c
  head/lib/libc/secure/stack_protector.c
  head/lib/libc/stdlib/rand.c
  head/lib/libc/xdr/xdr_float.c
  head/lib/libc/yp/yplib.c

Modified: head/lib/libc/db/btree/bt_split.c
==
--- head/lib/libc/db/btree/bt_split.c   Mon Apr 18 20:56:21 2016
(r298225)
+++ head/lib/libc/db/btree/bt_split.c   Mon Apr 18 21:05:15 2016
(r298226)
@@ -36,7 +36,6 @@ static char sccsid[] = "@(#)bt_split.c8
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
 #include 
 
 #include 

Modified: head/lib/libc/gen/arc4random.c
==
--- head/lib/libc/gen/arc4random.c  Mon Apr 18 20:56:21 2016
(r298225)
+++ head/lib/libc/gen/arc4random.c  Mon Apr 18 21:05:15 2016
(r298226)
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/lib/libc/gen/devname.c
==
--- head/lib/libc/gen/devname.c Mon Apr 18 20:56:21 2016(r298225)
+++ head/lib/libc/gen/devname.c Mon Apr 18 21:05:15 2016(r298226)
@@ -33,14 +33,13 @@ static char sccsid[] = "@(#)devname.c   8.
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
+#include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 char *

Modified: head/lib/libc/gen/exec.c
==
--- head/lib/libc/gen/exec.cMon Apr 18 20:56:21 2016(r298225)
+++ head/lib/libc/gen/exec.cMon Apr 18 21:05:15 2016(r298226)
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/lib/libc/gen/getnetgrent.c
==
--- head/lib/libc/gen/getnetgrent.c Mon Apr 18 20:56:21 2016
(r298225)
+++ head/lib/libc/gen/getnetgrent.c Mon Apr 18 21:05:15 2016
(r298226)
@@ -85,9 +85,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
+#include 
 #include 
 static char *_netgr_yp_domain;
 int _use_only_yp;

Modified: head/lib/libc/gen/setproctitle.c
==
--- head/lib/libc/gen/setproctitle.cMon Apr 18 20:56:21 2016
(r298225)
+++ head/lib/libc/gen/setproctitle.cMon Apr 18 21:05:15 2016
(r298226)
@@ -19,7 +19,6 @@
 __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
-#include 
 #include 
 #include 
 #include 

Modified: head/lib/libc/inet/inet_addr.c
==
--- head/lib/libc/inet/inet_addr.c  Mon Apr 18 20:56:21 2016
(r298225)
+++ head/lib/libc/inet/inet_addr.c  Mon Apr 18 21:05:15 2016
(r298226)
@@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$");
 
 #include "port_before.h"
 
-#include 
 #include 
 
 #include 

Modified: head/lib/libc/inet/inet_ntop.c
==
--- head/lib/libc/inet/inet_ntop.c  Mon Apr 18 20:56:21 2016
(r298225)
+++ head/lib/libc/inet/inet_ntop.c  Mon Apr 18 21:05:15 2016
(r298226)
@@ -24,7 +24,6 @@ __FBSDID("$FreeBSD$");
 #include "port_before.h"
 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/lib/libc/inet/inet_pton.c

svn commit: r298227 - head/share/mk

2016-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Mon Apr 18 21:05:19 2016
New Revision: 298227
URL: https://svnweb.freebsd.org/changeset/base/298227

Log:
  Update meta2deps to fix crash when using -X with M2D_EXCLUDES.

Modified:
  head/share/mk/meta2deps.py

Modified: head/share/mk/meta2deps.py
==
--- head/share/mk/meta2deps.py  Mon Apr 18 21:05:15 2016(r298226)
+++ head/share/mk/meta2deps.py  Mon Apr 18 21:05:19 2016(r298227)
@@ -38,7 +38,7 @@ We only pay attention to a subset of the
 
 """
 RCSid:
-   $Id: meta2deps.py,v 1.18 2015/04/03 18:23:25 sjg Exp $
+   $Id: meta2deps.py,v 1.19 2016/04/02 20:45:40 sjg Exp $
 
Copyright (c) 2011-2013, Juniper Networks, Inc.
All rights reserved.
@@ -483,7 +483,7 @@ class MetaFile:
 for p in self.excludes:
 if p and path.startswith(p):
 if self.debug > 2:
-print >> self.debug_out, "exclude:", p, path
+print("exclude:", p, path, file=self.debug_out)
 return
 # we don't want to resolve the last component if it is
 # a symlink
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298225 - head/share/mk

2016-04-18 Thread Simon J. Gerraty
Author: sjg
Date: Mon Apr 18 20:56:21 2016
New Revision: 298225
URL: https://svnweb.freebsd.org/changeset/base/298225

Log:
  Update dirdeps.mk et al
  
  dirdeps.mk: move logic to handle -f dirdeps.mk to inside check
  for first read of dirdeps.mk
  
  Also fix handling of WITHOUT_DIRDEPS_BELOW
  
  gendirdeps.mk: pass M2D_EXCLUDES to meta2deps
  
  meta.autodep.mk: if we build with nofilemon, leave a cookie to
  prevent updating dependencies until cleaned.
  
  Reviewed by:  bdrewery

Modified:
  head/share/mk/dirdeps.mk
  head/share/mk/gendirdeps.mk
  head/share/mk/meta.autodep.mk

Modified: head/share/mk/dirdeps.mk
==
--- head/share/mk/dirdeps.mkMon Apr 18 20:33:44 2016(r298224)
+++ head/share/mk/dirdeps.mkMon Apr 18 20:56:21 2016(r298225)
@@ -122,6 +122,23 @@ _DIRDEP_USE_LEVEL?= 0
 # and non-specific Makefile.depend*
 
 .if !target(_DIRDEP_USE)
+
+.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} 
!= ""
+# This little trick let's us do
+#
+# mk -f dirdeps.mk some/dir.${TARGET_SPEC}
+#
+all:
+${.TARGETS:Nall}: all
+DIRDEPS := ${.TARGETS:M*[/.]*}
+# so that -DNO_DIRDEPS works
+DEP_RELDIR := ${DIRDEPS:[1]:R}
+# this will become DEP_MACHINE below
+TARGET_MACHINE := ${DIRDEPS:[1]:E:C/,.*//}
+# disable DIRDEPS_CACHE as it does not like this trick
+MK_DIRDEPS_CACHE = no
+.endif
+
 # make sure we get the behavior we expect
 .MAKE.SAVE_DOLLARS = no
 
@@ -245,20 +262,6 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_tspec
 DEP_MACHINE := ${_DEP_TARGET_SPEC}
 .endif
 
-.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} 
!= ""
-# This little trick let's us do
-#
-# mk -f dirdeps.mk some/dir.${TARGET_SPEC}
-#
-all:
-${.TARGETS:Nall}: all
-DIRDEPS := ${.TARGETS:M*/*}
-# so that -DNO_DIRDEPS works
-DEP_RELDIR := ${DIRDEPS:R:[1]}
-# disable DIRDEPS_CACHE as it does not like this trick
-MK_DIRDEPS_CACHE = no
-.endif
-
 # reset each time through
 _build_all_dirs =
 
@@ -285,7 +288,7 @@ _DEP_RELDIR := ${DEP_RELDIR}
 # pickup customizations
 # as below you can use !target(_DIRDEP_USE) to protect things
 # which should only be done once.
-.-include "local.dirdeps.mk"
+.-include 
 
 .if !target(_DIRDEP_USE)
 # things we skip for host tools
@@ -305,7 +308,13 @@ DEP_SKIP_DIR = ${SKIP_DIR} \
 
 NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}}
 
-.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS)
+.if defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS)
+NO_DIRDEPS =
+.elif defined(WITHOUT_DIRDEPS_BELOW)
+NO_DIRDEPS_BELOW =
+.endif
+
+.if defined(NO_DIRDEPS)
 # confine ourselves to the original dir and below.
 DIRDEPS_FILTER += M${_DEP_RELDIR}*
 .elif defined(NO_DIRDEPS_BELOW)
@@ -371,7 +380,7 @@ MK_DIRDEPS_CACHE ?= no
 BUILD_DIRDEPS_CACHE ?= no
 BUILD_DIRDEPS ?= yes
 
-.if !defined(NO_DIRDEPS)
+.if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW)
 .if ${MK_DIRDEPS_CACHE} == "yes"
 # this is where we will cache all our work
 DIRDEPS_CACHE?= 
${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.}
@@ -453,7 +462,7 @@ _this_dir := ${SRCTOP}/${DEP_RELDIR}
 
 # on rare occasions, there can be a need for extra help
 _dep_hack := ${_this_dir}/${.MAKE.DEPENDFILE_PREFIX}.inc
-.-include "${_dep_hack}"
+.-include <${_dep_hack}>
 
 .if ${DEP_RELDIR} != ${_DEP_RELDIR} || ${DEP_TARGET_SPEC} != ${TARGET_SPEC}
 # this should be all

Modified: head/share/mk/gendirdeps.mk
==
--- head/share/mk/gendirdeps.mk Mon Apr 18 20:33:44 2016(r298224)
+++ head/share/mk/gendirdeps.mk Mon Apr 18 20:56:21 2016(r298225)
@@ -83,7 +83,7 @@ META_FILES := ${META_FILES:T:O:u}
 .export META_FILES
 
 # pickup customizations
-.-include "local.gendirdeps.mk"
+.-include 
 
 # these are actually prefixes that we'll skip
 # they should all be absolute paths
@@ -139,7 +139,8 @@ META2DEPS_CMD += -T ${TARGET_OBJ_SPEC}
 .endif
 META2DEPS_CMD += \
-R ${RELDIR} -H ${HOST_TARGET} \
-   ${M2D_OBJROOTS:O:u:@o@-O $o@}
+   ${M2D_OBJROOTS:O:u:@o@-O $o@} \
+   ${M2D_EXCLUDES:O:u:@o@-X $o@} \
 
 
 M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot}
@@ -256,6 +257,7 @@ DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER
 
 .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
 .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS}
+.info ${RELDIR}: M2D_EXCLUDES=${M2D_EXCLUDES}
 .info ${RELDIR}: dir_list='${dir_list}'
 .info ${RELDIR}: dpadd_dir_list='${dpadd_dir_list}'
 .info ${RELDIR}: dirdep_list='${dirdep_list}'

Modified: head/share/mk/meta.autodep.mk
==
--- head/share/mk/meta.autodep.mk   Mon Apr 18 20:33:44 2016
(r298224)
+++ head/share/mk/meta.autodep.mk   Mon Apr 18 20:56:21 2016
(r298225)
@@ -19,7 +19,7 @@ _this ?= ${.PARSEFILE}
 .if !target(__${_this}__)
 __${_this}__: .NOTMAIN
 
-.-include "local.autodep.mk"
+.-include 
 
 

svn commit: r298224 - in head/sys/dev: e1000 ixgbe

2016-04-18 Thread Sean Bruno
Author: sbruno
Date: Mon Apr 18 20:33:44 2016
New Revision: 298224
URL: https://svnweb.freebsd.org/changeset/base/298224

Log:
  Correct possible underflow conditions when checking for available space
  in the tx h/w ring buffer.
  
  Reviewed by:  gnn jeb.j.cra...@intel.com
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D5918

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/ixgbe/ix_txrx.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Apr 18 20:16:41 2016(r298223)
+++ head/sys/dev/e1000/if_em.c  Mon Apr 18 20:33:44 2016(r298224)
@@ -2092,7 +2092,7 @@ retry:
txr->tx_tso = FALSE;
}
 
-if (nsegs > (txr->tx_avail - EM_MAX_SCATTER)) {
+if (txr->tx_avail < (nsegs + EM_MAX_SCATTER)) {
 txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Mon Apr 18 20:16:41 2016(r298223)
+++ head/sys/dev/e1000/if_igb.c Mon Apr 18 20:33:44 2016(r298224)
@@ -1887,7 +1887,7 @@ retry:
}
 
/* Make certain there are enough descriptors */
-   if (nsegs > txr->tx_avail - 2) {
+   if (txr->tx_avail < (nsegs + 2)) {
txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);

Modified: head/sys/dev/e1000/if_lem.c
==
--- head/sys/dev/e1000/if_lem.c Mon Apr 18 20:16:41 2016(r298223)
+++ head/sys/dev/e1000/if_lem.c Mon Apr 18 20:33:44 2016(r298224)
@@ -1699,7 +1699,7 @@ lem_xmit(struct adapter *adapter, struct
return (error);
}
 
-if (nsegs > (adapter->num_tx_desc_avail - 2)) {
+if (adapter->num_tx_desc_avail < (nsegs + 2)) {
 adapter->no_tx_desc_avail2++;
bus_dmamap_unload(adapter->txtag, map);
return (ENOBUFS);

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cMon Apr 18 20:16:41 2016
(r298223)
+++ head/sys/dev/ixgbe/ix_txrx.cMon Apr 18 20:33:44 2016
(r298224)
@@ -402,7 +402,7 @@ retry:
}
 
/* Make certain there are enough descriptors */
-   if (nsegs > txr->tx_avail - 2) {
+   if (txr->tx_avail < (nsegs + 2)) {
txr->no_desc_avail++;
bus_dmamap_unload(txr->txtag, map);
return (ENOBUFS);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298223 - in head/sys: netinet netinet6

2016-04-18 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 18 20:16:41 2016
New Revision: 298223
URL: https://svnweb.freebsd.org/changeset/base/298223

Log:
  Address issues found by the XCode code analyzer.

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctputil.c
  head/sys/netinet/sctputil.h
  head/sys/netinet6/sctp6_usrreq.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Mon Apr 18 19:27:51 2016
(r298222)
+++ head/sys/netinet/sctp_indata.c  Mon Apr 18 20:16:41 2016
(r298223)
@@ -413,7 +413,6 @@ sctp_place_control_in_stream(struct sctp
 
 static void
 sctp_abort_in_reasm(struct sctp_tcb *stcb,
-struct sctp_stream_in *strm,
 struct sctp_queued_to_read *control,
 struct sctp_tmit_chunk *chk,
 int *abort_flag, int opspot)
@@ -431,7 +430,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stc
chk->rec.data.fsn_num, chk->rec.data.stream_seq);
} else {
snprintf(msg, sizeof(msg),
-   "Reass %x, CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x, SSN:%4.4x",
+   "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x",
opspot,
control->fsn_included,
chk->rec.data.TSN_seq,
@@ -610,16 +609,13 @@ protocol_error:
 * to put it on the queue.
 */
if (sctp_place_control_in_stream(strm, asoc, control)) {
-   char msg[SCTP_DIAG_INFO_LEN];
-   struct mbuf *oper;
-
snprintf(msg, sizeof(msg),
"Queue to str msg_id: %u duplicate",
control->msg_id);
clean_up_control(stcb, control);
-   oper = 
sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
+   op_err = 
sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA 
+ SCTP_LOC_3;
-   sctp_abort_an_association(stcb->sctp_ep, stcb, oper, 
SCTP_SO_NOT_LOCKED);
+   sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, 
SCTP_SO_NOT_LOCKED);
*abort_flag = 1;
}
}
@@ -829,7 +825,7 @@ restart:
TAILQ_REMOVE(>uno_inqueue, 
control, next_instrm);
control->on_strm_q = 0;
}
-   sctp_wakeup_the_read_socket(stcb->sctp_ep);
+   sctp_wakeup_the_read_socket(stcb->sctp_ep, 
stcb, SCTP_SO_NOT_LOCKED);
if ((nc) && (nc->first_frag_seen)) {
/*
 * Switch to the new guy and
@@ -852,7 +848,7 @@ restart:
SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
strm->pd_api_started = 1;
control->pdapi_started = 1;
-   sctp_wakeup_the_read_socket(stcb->sctp_ep);
+   sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, 
SCTP_SO_NOT_LOCKED);
return (0);
} else {
return (1);
@@ -861,7 +857,6 @@ restart:
 
 static void
 sctp_inject_old_data_unordered(struct sctp_tcb *stcb, struct sctp_association 
*asoc,
-struct sctp_stream_in *strm,
 struct sctp_queued_to_read *control,
 struct sctp_tmit_chunk *chk,
 int *abort_flag)
@@ -908,7 +903,7 @@ sctp_inject_old_data_unordered(struct sc
 * only happen if we can get more TSN's
 * higher before the pd-api-point.
 */
-   sctp_abort_in_reasm(stcb, strm, control, chk,
+   sctp_abort_in_reasm(stcb, control, chk,
abort_flag,
SCTP_FROM_SCTP_INDATA + SCTP_LOC_4);
 
@@ -971,7 +966,7 @@ place_chunk:
chk->data = NULL;
}
sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
-   sctp_abort_in_reasm(stcb, strm, control, chk,
+   sctp_abort_in_reasm(stcb, control, chk,
abort_flag,
SCTP_FROM_SCTP_INDATA + SCTP_LOC_5);
return;
@@ -1010,7 +1005,6 @@ sctp_deliver_reasm_check(struct sctp_tcb
if ((control) &&
(asoc->idata_supported == 0)) {
/* Special handling needed for "old" data format */
-   nctl = TAILQ_NEXT(control, next_instrm);
if (sctp_handle_old_data(stcb, asoc, strm, control, pd_point)) {
goto done_un;
}

Re: svn commit: r298131 - head/sys/conf

2016-04-18 Thread Luiz Otavio O Souza
On Mon, Apr 18, 2016 at 3:19 AM, hiren panchasara wrote:
> On 04/17/16 at 12:20P, Alexander Leidinger wrote:
>>
>> Quoting Luiz Otavio O Souza (from Sat, 16 Apr 2016
>> 20:54:55 + (UTC)):
>>
>> > Author: loos
>> > Date: Sat Apr 16 20:54:55 2016
>> > New Revision: 298131
>> > URL: https://svnweb.freebsd.org/changeset/base/298131
>> >
>> > Log:
>> >   Add Codel to NOTES.
>>
>> I haven't found much documentation about this. It looks like it is
>> only available in PF, but not in dummynet. Is this correct? Are there
>> somewhere examples for the use of codel (options/parameters/HOWTO)? I
>> would expect in places where e.g. "red" could be used, but I don't
>> find any mention of codel in e.g. the FreeBSD handbook.

Yes, this code relies on pf and ALTQ, dummynet support isn't available (yet).

Dummynet support is being worked by Rasool Al-Saadi (see 'Dummynet AQM
v0.2- CoDel, FQ-CoDel, PIE and FQ-PIE for FreeBSD's ipfw/dummynet' in
freebsd-ipfw@)

I agree with the lack of documentation, but I couldn't fix the docs
myself, the ALTQ section hasn't received any update since the pf
import.

Examples bellow.

>
> I'd also appreciate if more details on 1) how to use it 2) under what
> scenarios/workloads would this be most beneficial. And more importantly
> 3) how was this addition validated.

As a parameterless[1] queue algorithm, the usage is very simple:

altq on igb0 codelq queue

This enables codel queueing on output packets for igb0.

Codel can also work together with the other schedulers:

 altq on igb5 hfsc bandwidth 100Mb queue {  q1  }
 queue q1 on igb5 hfsc (  codel, default  )

Codel is expected to help with xDSL links where the link quality can
vary with the time.  Its use should not produce any negative effect.

I'm not aware of any formal validation other than the tests done by
pfSense developers (code was written by eri@ at the time) and the
beneficial results reported by pfSense users over the years.

Luiz


[1]: http://www.bufferbloat.net/projects/codel/wiki
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298222 - head

2016-04-18 Thread Glen Barber
Author: gjb
Date: Mon Apr 18 19:27:51 2016
New Revision: 298222
URL: https://svnweb.freebsd.org/changeset/base/298222

Log:
  Add MK_AUTO_OBJ=no to ${MAKE} invocation if PKG_VERSION needs to be
  created to avoid creating ${.OBJDIR}.
  
  The duplicate REVISION/BRANCH/VERSION evaluation will be addressed
  separately.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Apr 18 18:39:43 2016(r298221)
+++ head/Makefile.inc1  Mon Apr 18 19:27:51 2016(r298222)
@@ -195,8 +195,8 @@ VERSION=FreeBSD ${REVISION}-${BRANCH:C/
 .endif
 
 .if !defined(PKG_VERSION)
-REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION
-BRANCH!=   ${MAKE} -C ${SRCDIR}/release -V BRANCH
+REVISION!= MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V REVISION
+BRANCH!=   MK_AUTO_OBJ=no ${MAKE} -C ${SRCDIR}/release -V BRANCH
 SRCRELDATE!=   awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
${SRCDIR}/sys/sys/param.h
 .if ${BRANCH:MSTABLE*} || ${BRANCH:MCURRENT*}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298199 - head/sys/netinet

2016-04-18 Thread Michael Tuexen
> On 18 Apr 2016, at 19:48, Ian Lepore  wrote:
> 
> On Mon, 2016-04-18 at 18:58 +0200, Michael Tuexen wrote:
>>> On 18 Apr 2016, at 17:10, Ian Lepore  wrote:
>>> 
>>> On Mon, 2016-04-18 at 09:29 +, Michael Tuexen wrote:
 Author: tuexen
 Date: Mon Apr 18 09:29:14 2016
 New Revision: 298199
 URL: https://svnweb.freebsd.org/changeset/base/298199
 
 Log:
 Put panic() calls under INVARIANTS.
 
>>> 
>>> A panic that's only active when INVARIANTS is defined is usually
>>> spelled KASSERT.
>> OK. The change happens because when using the code in the userland
>> SCTP stack, we don't provide a panic() replacement unless we
>> compile the INVARIANTS defined. Therefore I catch this when compiling
>> the userland stack...
>> 
>> Best regards
>> Michael
>>> 
> 
> Ahh, no KASSERT in userland, thanks.  I probably could have figured
> that out for myself if I had put a bit of effort into looking.
Well, we also have KASSERT in the userland code. All panic() calls
in the SCTP code are under INVARIANTS and only the last integrated
changes broke with the rule. I detected this when getting these
changes into the userland code and therefore I fixed it.
I'll try to convert them to KASSERTs sometime in the future. But
this has not high priority right now...

Thanks for making me aware of it.

Best regards
Michael
> 
> -- Ian
> 

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/

2016-04-18 Thread John Baldwin
On Saturday, April 16, 2016 07:45:31 AM Glen Barber wrote:
> Author: gjb
> Date: Sat Apr 16 07:45:30 2016
> New Revision: 298107
> URL: https://svnweb.freebsd.org/changeset/base/298107
> 
> Log:
>   Merge the projects/release-pkg branch to head.
>   
>   This allows packaging the base system with pkg(8), including
>   but not limited to providing the ability to provide upstream
>   binary update possibilities for non-tier-1 architectures.
>   
>   This merge is a requirement of the 11.0-RELEASE, and as such,
>   thank you to everyone that has tested the project branch.
>   
>   Documentation in build(7) etc. is still somewhat sparse, but
>   updates to those parts will follow.
>   
>   Sponsored by:   The FreeBSD Foundation
> 
> Replaced:
>   head/sys/boot/forth/Makefile
>  - copied unchanged from r298104, 
> projects/release-pkg/sys/boot/forth/Makefile

You destroyed the history for this file in a way that is pretty much
impossible to recover.  Compare svn log of stable/10/sys/boot/forth/Makefile
with head/sys/boot/forth/Makefile.

This is why svn merge IMO should _never_ be used from a projects or user
branch into HEAD.  It is just too broken.  I think we should always use
'svn diff > foo.patch' and 'svn patch foo.patch' in a clean checkout instead.

(Note that previous merges such as the initial bhyve import have also
destroyed history on files, so this is something that happens fairly often
on merges from project branches.  I really do think we should forbid them
and document that as such.)

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298221 - head

2016-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Mon Apr 18 18:39:43 2016
New Revision: 298221
URL: https://svnweb.freebsd.org/changeset/base/298221

Log:
  Follow-up r298220: Don't pass down META_MODE which will still enable it.
  
  Reported by:  Nikolai Lifanov 
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Mon Apr 18 18:14:05 2016(r298220)
+++ head/Makefile   Mon Apr 18 18:39:43 2016(r298221)
@@ -189,6 +189,7 @@ _MAKE=  PATH=${PATH} ${SUB_MAKE} -f Makef
 # redundant restaging but is dangerous for user install targets.
 .if make(distrib*) || make(*install*)
 _MAKE+=MK_META_MODE=no
+.unexport META_MODE
 .endif
 
 # Guess machine architecture from machine type, and vice versa.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/

2016-04-18 Thread Glen Barber
On Mon, Apr 18, 2016 at 03:20:05PM -0300, Renato Botelho wrote:
> > On Apr 16, 2016, at 04:45, Glen Barber  wrote:
> > 
> > Author: gjb
> > Date: Sat Apr 16 07:45:30 2016
> > New Revision: 298107
> > URL: https://svnweb.freebsd.org/changeset/base/298107
> > 
> > Log:
> >  Merge the projects/release-pkg branch to head.
> > 
> >  This allows packaging the base system with pkg(8), including
> >  but not limited to providing the ability to provide upstream
> >  binary update possibilities for non-tier-1 architectures.
> > 
> >  This merge is a requirement of the 11.0-RELEASE, and as such,
> >  thank you to everyone that has tested the project branch.
> > 
> >  Documentation in build(7) etc. is still somewhat sparse, but
> >  updates to those parts will follow.
> > 
> >  Sponsored by:  The FreeBSD Foundation
> > 
> 
> Glen,
> 
> During CFT message you mentioned a patch should be applied to ports-mgmt/pkg 
> to keep track of base shared libraries. Is it still necessary? If yes, do you 
> know when it’s going to be applied in pkg?
> 

It is included in pkg 1.7.x, so no patch is required anymore.

Glen



signature.asc
Description: PGP signature


Re: svn commit: r298107 - in head: . bin/cat bin/cat/tests bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/date/tests bin/dd bin/dd/tests bin/df bin/domainname bin/echo bin/ed bin/expr bin/

2016-04-18 Thread Renato Botelho
> On Apr 16, 2016, at 04:45, Glen Barber  wrote:
> 
> Author: gjb
> Date: Sat Apr 16 07:45:30 2016
> New Revision: 298107
> URL: https://svnweb.freebsd.org/changeset/base/298107
> 
> Log:
>  Merge the projects/release-pkg branch to head.
> 
>  This allows packaging the base system with pkg(8), including
>  but not limited to providing the ability to provide upstream
>  binary update possibilities for non-tier-1 architectures.
> 
>  This merge is a requirement of the 11.0-RELEASE, and as such,
>  thank you to everyone that has tested the project branch.
> 
>  Documentation in build(7) etc. is still somewhat sparse, but
>  updates to those parts will follow.
> 
>  Sponsored by:The FreeBSD Foundation
> 

Glen,

During CFT message you mentioned a patch should be applied to ports-mgmt/pkg to 
keep track of base shared libraries. Is it still necessary? If yes, do you know 
when it’s going to be applied in pkg?

--
Renato Botelho

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r297842 - in head/gnu/lib: csu libgcc libgcov

2016-04-18 Thread Bryan Drewery
On 4/16/2016 5:05 AM, Jilles Tjoelker wrote:
> On Tue, Apr 12, 2016 at 02:45:19AM +, Bryan Drewery wrote:
>> Author: bdrewery
>> Date: Tue Apr 12 02:45:19 2016
>> New Revision: 297842
>> URL: https://svnweb.freebsd.org/changeset/base/297842
> 
>> Log:
>>   META_MODE: Avoid changed build command every build.
> 
>>   Because the file is generated with -f using another Makefile, 2
>>   different Makefiles are trying to handle the .meta file for the
>>   target.  The obvious .NOMETA_CMP or .NOMETA on the ${MAKE} targets
>>   don't work as they are very limited in scope in bmake.  Using
>>   .PHONY fixes the problem and ensures that the ${MAKE} command
>>   is always ran to check if it is outdated in the sub-make.
> 
>>   An example of the problem in gnu/lib/libgcc (with make -dM):
>> /usr/obj/root/git/freebsd/gnu/lib/libgcc/tm.h.meta: 2: a build command 
>> has changed
>> TARGET_CPU_DEFAULT=""  HEADERS="options.h i386/biarch64.h i386/i386.h 
>> i386/unix.h i386/att.h dbxelf.h elfos-undef.h elfos.h freebsd-native.h 
>> freebsd-spec.h freebsd.h i386/x86-64.h i386/freebsd.h i386/freebsd64.h 
>> defaults.h"  DEFINES=""  /bin/sh 
>> /root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc/mkconfig.sh tm.h
>> vs
>> (cd /root/git/freebsd/gnu/lib/libgcc; make -f 
>> /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile 
>> MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile 
>> GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h)
>> Skipping meta for tm.h: .NOMETA
>> (cd /root/git/freebsd/gnu/lib/libgcc; make -f 
>> /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile 
>> MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile 
>> GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h)
>> `tm.h' is up to date.
> 
>> Modified:
>>   head/gnu/lib/csu/Makefile
>>   head/gnu/lib/libgcc/Makefile
>>   head/gnu/lib/libgcov/Makefile
> 
>> Modified: head/gnu/lib/csu/Makefile
>> ==
>> --- head/gnu/lib/csu/MakefileTue Apr 12 02:01:16 2016
>> (r297841)
>> +++ head/gnu/lib/csu/MakefileTue Apr 12 02:45:19 2016
>> (r297842)
>> @@ -71,7 +71,7 @@ crtendS.o: ${ENDSRC}
>>  -c -o ${.TARGET} ${.ALLSRC:N*.h}
>>  
>>  CLEANFILES+=tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
>> -tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
>> +tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY
>>  (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
>> ${.TARGET})
>>  
>>  .include 
>>
>> Modified: head/gnu/lib/libgcc/Makefile
>> ==
>> --- head/gnu/lib/libgcc/Makefile Tue Apr 12 02:01:16 2016
>> (r297841)
>> +++ head/gnu/lib/libgcc/Makefile Tue Apr 12 02:45:19 2016
>> (r297842)
>> @@ -343,7 +343,7 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS
>>  #
>>  # Generated headers
>>  #
>> -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
>> +${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY
>>  (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
>> ${.TARGET})
>>  
>>  CLEANFILES += ${COMMONHDRS}
>>
>> Modified: head/gnu/lib/libgcov/Makefile
>> ==
>> --- head/gnu/lib/libgcov/MakefileTue Apr 12 02:01:16 2016
>> (r297841)
>> +++ head/gnu/lib/libgcov/MakefileTue Apr 12 02:45:19 2016
>> (r297842)
>> @@ -45,7 +45,7 @@ CC_S = ${CC} -c ${CFLAGS} ${PICFLAG} -DS
>>  COMMONHDRS= tm.h tconfig.h gcov-iov.h options.h
>>  CLEANFILES+=${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist
>>  
>> -${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
>> +${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY
>>  (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
>> ${.TARGET})
>>  
>>  ${OBJS} beforedepend: ${COMMONHDRS}
> 
> Unfortunately, this causes things to be built every time for
> non-metamode builds, including make installworld. I had to revert the
> gnu/lib/csu/Makefile part locally to get make installworld with a
> read-only /usr/obj to work again.
> 

Yup, it does in META MODE as well. I failed to do an install test.

r298218 fixes it and I added an error in install if a rebuild occurs in
r298219 to help catch these earlier.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r298218 - in head/gnu: lib/csu lib/libgcc lib/libgcov usr.bin/cc/cc_tools

2016-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Mon Apr 18 18:13:58 2016
New Revision: 298218
URL: https://svnweb.freebsd.org/changeset/base/298218

Log:
  Follow-up r297842: Rework header generation to fix always rebuilding.
  
  This reworks the handling of common headers to just include the needed
  logic rather than invoke MAKE.  This avoids the problem listed in r297842
  and avoids other dependency tracking issues.
  
  Pointyhat to: bdrewery
  Reported by:  Nikolai Lifanov 
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/gnu/usr.bin/cc/cc_tools/Makefile.hdrs   (contents, props changed)
Modified:
  head/gnu/lib/csu/Makefile
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libgcov/Makefile
  head/gnu/usr.bin/cc/cc_tools/Makefile

Modified: head/gnu/lib/csu/Makefile
==
--- head/gnu/lib/csu/Makefile   Mon Apr 18 18:12:12 2016(r298217)
+++ head/gnu/lib/csu/Makefile   Mon Apr 18 18:13:58 2016(r298218)
@@ -7,10 +7,11 @@ GCCDIR=   ${.CURDIR}/../../../contrib/gcc
 GCCLIB=${.CURDIR}/../../../contrib/gcclibs
 CCDIR= ${.CURDIR}/../../usr.bin/cc
 .include "${CCDIR}/Makefile.tgt"
+.include "${CCDIR}/cc_tools/Makefile.hdrs"
 
 .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
 
-SRCS=  crtstuff.c tconfig.h tm.h options.h
+SRCS=  crtstuff.c ${COMMONHDRS}
 OBJS=  crtbegin.o crtend.o crtbeginT.o
 SOBJS= crtbeginS.o crtendS.o
 CSTD?= gnu89
@@ -70,8 +71,7 @@ crtendS.o:${ENDSRC}
${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
-c -o ${.TARGET} ${.ALLSRC:N*.h}
 
-CLEANFILES+=   tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
-tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile .PHONY
-   (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
${.TARGET})
+COMMONHDRS+=   tm.h tconfig.h options.h
+CLEANFILES+=   ${COMMONHDRS} optionlist cs-tconfig.h cs-tm.h
 
 .include 

Modified: head/gnu/lib/libgcc/Makefile
==
--- head/gnu/lib/libgcc/MakefileMon Apr 18 18:12:12 2016
(r298217)
+++ head/gnu/lib/libgcc/MakefileMon Apr 18 18:13:58 2016
(r298218)
@@ -3,6 +3,7 @@
 PACKAGE=   clibs
 GCCDIR=${.CURDIR}/../../../contrib/gcc
 GCCLIB=${.CURDIR}/../../../contrib/gcclibs
+CCDIR= ${.CURDIR}/../../usr.bin/cc
 COMPILERRTDIR= ${.CURDIR}/../../../contrib/compiler-rt
 UNWINDINCDIR=  ${.CURDIR}/../../../contrib/llvm/projects/libunwind/include
 UNWINDSRCDIR=  ${.CURDIR}/../../../contrib/llvm/projects/libunwind/src
@@ -17,7 +18,8 @@ SHLIBDIR?=/lib
 #
 MK_SSP=no
 
-.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
+.include "${CCDIR}/Makefile.tgt"
+.include "${CCDIR}/cc_tools/Makefile.hdrs"
 
 .if ${TARGET_CPUARCH} == "arm"
 CFLAGS+=   -DTARGET_ARM_EABI
@@ -29,7 +31,7 @@ CFLAGS+=  -DIN_GCC -DIN_LIBGCC2 -D__GCC_F
-DHAVE_GTHR_DEFAULT \
-I${GCCLIB}/include \
-I${GCCDIR}/config -I${GCCDIR} -I. \
-   -I${.CURDIR}/../../usr.bin/cc/cc_tools
+   -I${CCDIR}/cc_tools
 
 LDFLAGS+=  -nodefaultlibs
 LIBADD+=   c
@@ -340,13 +342,6 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS
 .endfor
 
 
-#---
-#
-# Generated headers
-#
-${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY
-   (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} 
${.TARGET})
-
 CLEANFILES += ${COMMONHDRS}
 CLEANFILES += cs-*.h option*
 

Modified: head/gnu/lib/libgcov/Makefile
==
--- head/gnu/lib/libgcov/Makefile   Mon Apr 18 18:12:12 2016
(r298217)
+++ head/gnu/lib/libgcov/Makefile   Mon Apr 18 18:13:58 2016
(r298218)
@@ -4,17 +4,20 @@ MK_PROFILE=   no
 MK_SSP=no
 
 .include 
-.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
 
 GCCDIR=${.CURDIR}/../../../contrib/gcc
 GCCLIB=${.CURDIR}/../../../contrib/gcclibs
+CCDIR= ${.CURDIR}/../../usr.bin/cc
+.include "${CCDIR}/Makefile.tgt"
+.include "${CCDIR}/cc_tools/Makefile.hdrs"
+
 .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}
 
 LIB=   gcov
 
 CFLAGS+=   -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
 CFLAGS+=   -D_PTHREADS -DGTHREAD_USE_WEAK
-CFLAGS+=   -I${.CURDIR}/../../usr.bin/cc/cc_tools \
+CFLAGS+=   -I${CCDIR}/cc_tools \
-I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I.
 
 .if ${TARGET_CPUARCH} == "arm"
@@ -45,9 +48,6 @@ CC_S =${CC} -c ${CFLAGS} ${PICFLAG} -DS
 COMMONHDRS=tm.h tconfig.h gcov-iov.h options.h
 CLEANFILES+=   ${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist
 
-${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile .PHONY
-   (cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} 

svn commit: r298219 - head/share/mk

2016-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Mon Apr 18 18:14:02 2016
New Revision: 298219
URL: https://svnweb.freebsd.org/changeset/base/298219

Log:
  Cause an error during 'make install' if trying to compile with CC.
  
  This is limited to src-tree builds, meaning not extended to ports or other
  out-of-tree builds.
  
  This will help ensure that read-only OBJDIRS will be respected at install-time
  by causing a more consistent failure for those who don't use a read-only
  OBJDIR.  It also will cause Jenkins to yell.  This is a better solution than
  trying to see CC=false as has been attempted and discussed before.
  
  Of course this is only relevant for files generated by CC.
  
  Disable this for META_MODE since it will detect the CFLAGS/command
  change and force a rebuild.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkMon Apr 18 18:13:58 2016(r298218)
+++ head/share/mk/bsd.sys.mkMon Apr 18 18:14:02 2016(r298219)
@@ -178,6 +178,13 @@ ACFLAGS+=  ${ACFLAGS.${.IMPSRC:T}}
 CFLAGS+=   ${CFLAGS.${.IMPSRC:T}}
 CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}}
 
+.if defined(SRCTOP)
+# Prevent rebuilding during install to support read-only objdirs.
+.if make(install) && empty(.MAKE.MODE:Mmeta)
+CFLAGS+=   ERROR-tried-to-rebuild-during-make-install
+.endif
+.endif
+
 # Tell bmake not to mistake standard targets for things to be searched for
 # or expect to ever be up-to-date.
 PHONY_NOTMAIN = analyze afterdepend afterinstall all beforedepend 
beforeinstall \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298220 - head

2016-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Mon Apr 18 18:14:05 2016
New Revision: 298220
URL: https://svnweb.freebsd.org/changeset/base/298220

Log:
  META_MODE: Disable during installworld and similar.
  
  META_MODE may create cookies during staging of files to WORLDTMP that would
  also prevent installation of the files to the final DESTDIR, since the cookie
  already exists.  This is not yet the case but will be soon.  Prevent other
  similar issues by disabling META_MODE for any top-level install targets.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Mon Apr 18 18:14:02 2016(r298219)
+++ head/Makefile   Mon Apr 18 18:14:05 2016(r298220)
@@ -183,6 +183,14 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk
 
 _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} 
TARGET_ARCH=${_TARGET_ARCH}
 
+# Must disable META_MODE when installing to avoid missing anything.  The
+# main problem is that buildworld will create cookies for install targets
+# since they are being installed into WORLDTMP.  This avoids unneeded and
+# redundant restaging but is dangerous for user install targets.
+.if make(distrib*) || make(*install*)
+_MAKE+=MK_META_MODE=no
+.endif
+
 # Guess machine architecture from machine type, and vice versa.
 .if !defined(TARGET_ARCH) && defined(TARGET)
 _TARGET_ARCH=  ${TARGET:S/pc98/i386/:S/arm64/aarch64/}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298217 - head/share/mk

2016-04-18 Thread Bryan Drewery
Author: bdrewery
Date: Mon Apr 18 18:12:12 2016
New Revision: 298217
URL: https://svnweb.freebsd.org/changeset/base/298217

Log:
  META_MODE: Clean .meta files with 'make cleandepend'.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==
--- head/share/mk/bsd.dep.mkMon Apr 18 17:30:33 2016(r298216)
+++ head/share/mk/bsd.dep.mkMon Apr 18 18:12:12 2016(r298217)
@@ -54,6 +54,9 @@ HTAGSFLAGS?=
 .MAKE.DEPENDFILE= ${DEPENDFILE}
 .endif
 CLEANDEPENDFILES+= ${DEPENDFILE} ${DEPENDFILE}.*
+.if ${MK_META_MODE} == "yes"
+CLEANDEPENDFILES+= *.meta
+.endif
 
 # Keep `tags' here, before SRCS are mangled below for `depend'.
 .if !target(tags) && defined(SRCS) && !defined(NO_TAGS)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298199 - head/sys/netinet

2016-04-18 Thread Ian Lepore
On Mon, 2016-04-18 at 18:58 +0200, Michael Tuexen wrote:
> > On 18 Apr 2016, at 17:10, Ian Lepore  wrote:
> > 
> > On Mon, 2016-04-18 at 09:29 +, Michael Tuexen wrote:
> > > Author: tuexen
> > > Date: Mon Apr 18 09:29:14 2016
> > > New Revision: 298199
> > > URL: https://svnweb.freebsd.org/changeset/base/298199
> > > 
> > > Log:
> > >  Put panic() calls under INVARIANTS.
> > > 
> > 
> > A panic that's only active when INVARIANTS is defined is usually
> > spelled KASSERT.
> OK. The change happens because when using the code in the userland
> SCTP stack, we don't provide a panic() replacement unless we
> compile the INVARIANTS defined. Therefore I catch this when compiling
> the userland stack...
> 
> Best regards
> Michael
> > 

Ahh, no KASSERT in userland, thanks.  I probably could have figured
that out for myself if I had put a bit of effort into looking.

-- Ian

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298216 - in head/usr.sbin: btxld usbdump

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 17:30:33 2016
New Revision: 298216
URL: https://svnweb.freebsd.org/changeset/base/298216

Log:
  Reuse our roundup2() macro instead of reinventing the wheel.
  
  Obtained from:DragonflyBSD

Modified:
  head/usr.sbin/btxld/btxld.c
  head/usr.sbin/usbdump/usbdump.c

Modified: head/usr.sbin/btxld/btxld.c
==
--- head/usr.sbin/btxld/btxld.c Mon Apr 18 16:25:37 2016(r298215)
+++ head/usr.sbin/btxld/btxld.c Mon Apr 18 17:30:33 2016(r298216)
@@ -68,8 +68,6 @@ static const char rcsid[] =
 #define IMPURE 1   /* Writable text */
 #define MAXU32 0x  /* Maximum unsigned 32-bit quantity */
 
-#define align(x, y) (((x) + (y) - 1) & ~((y) - 1))
-
 struct hdr {
 uint32_t fmt;  /* Format */
 uint32_t flags;/* Bit flags */
@@ -425,7 +423,7 @@ puthdr(int fd, struct hdr *hdr)
eh.p[1].p_offset = htole32(le32toh(eh.p[0].p_offset) +
le32toh(eh.p[0].p_filesz));
eh.p[1].p_vaddr = eh.p[1].p_paddr =
-   htole32(align(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz),
+   htole32(roundup2(le32toh(eh.p[0].p_paddr) + 
le32toh(eh.p[0].p_memsz),
4096));
eh.p[1].p_filesz = eh.p[1].p_memsz = htole32(hdr->data);
eh.sh[2].sh_addr = eh.p[0].p_vaddr;

Modified: head/usr.sbin/usbdump/usbdump.c
==
--- head/usr.sbin/usbdump/usbdump.c Mon Apr 18 16:25:37 2016
(r298215)
+++ head/usr.sbin/usbdump/usbdump.c Mon Apr 18 17:30:33 2016
(r298216)
@@ -95,8 +95,6 @@ struct usbcap_filehdr {
uint8_t reserved[26];
 } __packed;
 
-#defineHEADER_ALIGN(x,a) (((x) + (a) - 1) & ~((a) - 1))
-
 struct header_32 {
/* capture timestamp */
uint32_t ts_sec;
@@ -622,7 +620,7 @@ print_packets(uint8_t *data, const int d
temp.hdrlen = hdr32->hdrlen;
temp.align = hdr32->align;
 
-   next = ptr + HEADER_ALIGN(temp.hdrlen + temp.caplen, 
temp.align);
+   next = ptr + roundup2(temp.hdrlen + temp.caplen, temp.align);
 
if (next <= ptr)
err(EXIT_FAILURE, "Invalid length");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298187 - head/sys/netinet

2016-04-18 Thread Michael Tuexen
> On 18 Apr 2016, at 17:08, Ian Lepore  wrote:
> 
> On Mon, 2016-04-18 at 06:38 +, Michael Tuexen wrote:
>> Author: tuexen
>> Date: Mon Apr 18 06:38:53 2016
>> New Revision: 298187
>> URL: https://svnweb.freebsd.org/changeset/base/298187
>> 
>> Log:
>>  Don't use anonymous unions.
>> 
> 
> Why not?  This is one of those commit messages that really needs to say
Because the same code is used in a userland SCTP stack and that
uses C99. Anonymous unions are introduced in C11. That's why.
> WHY the change is happening more than WHAT is happening.
Will try to provide better commit messages.

Best regards
Michael
> 
> -- Ian
> 
>> Modified:
>>  head/sys/netinet/sctp_header.h
>>  head/sys/netinet/sctp_indata.c
>>  head/sys/netinet/sctp_output.c
>> 
>> Modified: head/sys/netinet/sctp_header.h
>> =
>> =
>> --- head/sys/netinet/sctp_header.h   Mon Apr 18 06:32:24 2016
>> (r298186)
>> +++ head/sys/netinet/sctp_header.h   Mon Apr 18 06:38:53 2016
>> (r298187)
>> @@ -160,7 +160,7 @@ struct sctp_idata {
>>  union {
>>  uint32_t protocol_id;
>>  uint32_t fsn;   /* Fragment Sequence Number */
>> -};
>> +} ppid_fsn;
>>  /* user data follows */
>> }  SCTP_PACKED;
>> 
>> 
>> Modified: head/sys/netinet/sctp_indata.c
>> =
>> =
>> --- head/sys/netinet/sctp_indata.c   Mon Apr 18 06:32:24 2016
>> (r298186)
>> +++ head/sys/netinet/sctp_indata.c   Mon Apr 18 06:38:53 2016
>> (r298187)
>> @@ -1558,7 +1558,7 @@ sctp_process_a_data_chunk(struct sctp_tc
>>  if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG)
>>  fsn = 0;
>>  else
>> -fsn = ntohl(nch->dp.fsn);
>> +fsn = ntohl(nch->dp.ppid_fsn.fsn);
>>  old_data = 0;
>>  } else {
>>  ch = (struct sctp_data_chunk *)sctp_m_getptr(*m,
>> offset,
>> 
>> Modified: head/sys/netinet/sctp_output.c
>> =
>> =
>> --- head/sys/netinet/sctp_output.c   Mon Apr 18 06:32:24 2016
>> (r298186)
>> +++ head/sys/netinet/sctp_output.c   Mon Apr 18 06:38:53 2016
>> (r298187)
>> @@ -7641,9 +7641,9 @@ dont_do_it:
>>  ndchkh->dp.reserved = htons(0);
>>  ndchkh->dp.msg_id = htonl(sp->msg_id);
>>  if (sp->fsn == 0)
>> -ndchkh->dp.protocol_id = chk
>> ->rec.data.payloadtype;
>> +ndchkh->dp.ppid_fsn.protocol_id = chk
>> ->rec.data.payloadtype;
>>  else
>> -ndchkh->dp.fsn = htonl(sp->fsn);
>> +ndchkh->dp.ppid_fsn.fsn = htonl(sp->fsn);
>>  sp->fsn++;
>>  ndchkh->ch.chunk_length = htons(chk->send_size);
>>  }
>> 

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298215 - head/lib/libc/gen

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 16:25:37 2016
New Revision: 298215
URL: https://svnweb.freebsd.org/changeset/base/298215

Log:
  Re-use our roundup2() macro instead of reinventing the wheel.
  
  Obtained from:DragonflyBSD

Modified:
  head/lib/libc/gen/tls.c

Modified: head/lib/libc/gen/tls.c
==
--- head/lib/libc/gen/tls.c Mon Apr 18 15:08:31 2016(r298214)
+++ head/lib/libc/gen/tls.c Mon Apr 18 16:25:37 2016(r298215)
@@ -33,6 +33,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -82,9 +83,6 @@ void __libc_free_tls(void *tls, size_t t
 
 #ifndef PIC
 
-#define round(size, align) \
-   (((size) + (align) - 1) & ~((align) - 1))
-
 static size_t tls_static_space;
 static size_t tls_init_size;
 static void *tls_init;
@@ -190,7 +188,7 @@ __libc_free_tls(void *tcb, size_t tcbsiz
 * Figure out the size of the initial TLS block so that we can
 * find stuff which ___tls_get_addr() allocated dynamically.
 */
-   size = round(tls_static_space, tcbalign);
+   size = roundup2(tls_static_space, tcbalign);
 
dtv = ((Elf_Addr**)tcb)[1];
tlsend = (Elf_Addr) tcb;
@@ -210,7 +208,7 @@ __libc_allocate_tls(void *oldtls, size_t
Elf_Addr *dtv;
Elf_Addr segbase, oldsegbase;
 
-   size = round(tls_static_space, tcbalign);
+   size = roundup2(tls_static_space, tcbalign);
 
if (tcbsize < 2 * sizeof(Elf_Addr))
tcbsize = 2 * sizeof(Elf_Addr);
@@ -307,7 +305,7 @@ _init_tls(void)
 
for (i = 0; (unsigned) i < phnum; i++) {
if (phdr[i].p_type == PT_TLS) {
-   tls_static_space = round(phdr[i].p_memsz,
+   tls_static_space = roundup2(phdr[i].p_memsz,
phdr[i].p_align);
tls_init_size = phdr[i].p_filesz;
tls_init = (void*) phdr[i].p_vaddr;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298199 - head/sys/netinet

2016-04-18 Thread Ian Lepore
On Mon, 2016-04-18 at 09:29 +, Michael Tuexen wrote:
> Author: tuexen
> Date: Mon Apr 18 09:29:14 2016
> New Revision: 298199
> URL: https://svnweb.freebsd.org/changeset/base/298199
> 
> Log:
>   Put panic() calls under INVARIANTS.
> 

A panic that's only active when INVARIANTS is defined is usually
spelled KASSERT.

-- Ian

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298212 - head/sys/cam/scsi

2016-04-18 Thread Alan Somers
Author: asomers
Date: Mon Apr 18 15:01:59 2016
New Revision: 298212
URL: https://svnweb.freebsd.org/changeset/base/298212

Log:
  Add the ability to read a SAS device's Target Port NAA designator
  
  sys/cam/scsi/scsi_all.h
  sys/cam/scsi/scsi_all.c
Add the scsi_devid_is_port_naa helper function
  
  Reviewed by:  ken
  MFC after:4 weeks
  Sponsored by: Spectra Logic Corp
  Differential Revision:https://reviews.freebsd.org/D5975

Modified:
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/scsi/scsi_all.c
==
--- head/sys/cam/scsi/scsi_all.cMon Apr 18 15:01:49 2016
(r298211)
+++ head/sys/cam/scsi/scsi_all.cMon Apr 18 15:01:59 2016
(r298212)
@@ -5626,6 +5626,19 @@ scsi_devid_is_lun_name(uint8_t *bufp)
return 1;
 }
 
+int
+scsi_devid_is_port_naa(uint8_t *bufp)
+{
+   struct scsi_vpd_id_descriptor *descr;
+
+   descr = (struct scsi_vpd_id_descriptor *)bufp;
+   if ((descr->id_type & SVPD_ID_ASSOC_MASK) != SVPD_ID_ASSOC_PORT)
+   return 0;
+   if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA)
+   return 0;
+   return 1;
+}
+
 struct scsi_vpd_id_descriptor *
 scsi_get_devid_desc(struct scsi_vpd_id_descriptor *desc, uint32_t len,
 scsi_devid_checkfn_t ck_fn)

Modified: head/sys/cam/scsi/scsi_all.h
==
--- head/sys/cam/scsi/scsi_all.hMon Apr 18 15:01:49 2016
(r298211)
+++ head/sys/cam/scsi/scsi_all.hMon Apr 18 15:01:59 2016
(r298212)
@@ -3661,6 +3661,7 @@ int   scsi_devid_is_lun_eui64(uint8_t *bu
 intscsi_devid_is_lun_naa(uint8_t *bufp);
 intscsi_devid_is_lun_name(uint8_t *bufp);
 intscsi_devid_is_lun_t10(uint8_t *bufp);
+intscsi_devid_is_port_naa(uint8_t *bufp);
 struct scsi_vpd_id_descriptor *
scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len,
   scsi_devid_checkfn_t ck_fn);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298211 - head/libexec/ftpd

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 15:01:49 2016
New Revision: 298211
URL: https://svnweb.freebsd.org/changeset/base/298211

Log:
  ftpd: replace malloc + memset 0 with calloc.
  
  It is faster and usually safer.
  Use NULL instead of zero for the pointer.

Modified:
  head/libexec/ftpd/popen.c

Modified: head/libexec/ftpd/popen.c
==
--- head/libexec/ftpd/popen.c   Mon Apr 18 14:45:56 2016(r298210)
+++ head/libexec/ftpd/popen.c   Mon Apr 18 15:01:49 2016(r298211)
@@ -81,9 +81,8 @@ ftpd_popen(char *program, char *type)
if (!pids) {
if ((fds = getdtablesize()) <= 0)
return (NULL);
-   if ((pids = malloc(fds * sizeof(int))) == NULL)
+   if ((pids = calloc(fds, sizeof(int))) == NULL)
return (NULL);
-   memset(pids, 0, fds * sizeof(int));
}
if (pipe(pdes) < 0)
return (NULL);
@@ -185,7 +184,7 @@ ftpd_pclose(FILE *iop)
 * pclose returns -1 if stream is not associated with a
 * `popened' command, or, if already `pclosed'.
 */
-   if (pids == 0 || pids[fdes = fileno(iop)] == 0)
+   if (pids == NULL || pids[fdes = fileno(iop)] == 0)
return (-1);
(void)fclose(iop);
omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298187 - head/sys/netinet

2016-04-18 Thread Ian Lepore
On Mon, 2016-04-18 at 06:38 +, Michael Tuexen wrote:
> Author: tuexen
> Date: Mon Apr 18 06:38:53 2016
> New Revision: 298187
> URL: https://svnweb.freebsd.org/changeset/base/298187
> 
> Log:
>   Don't use anonymous unions.
> 

Why not?  This is one of those commit messages that really needs to say
WHY the change is happening more than WHAT is happening.

-- Ian

> Modified:
>   head/sys/netinet/sctp_header.h
>   head/sys/netinet/sctp_indata.c
>   head/sys/netinet/sctp_output.c
> 
> Modified: head/sys/netinet/sctp_header.h
> =
> =
> --- head/sys/netinet/sctp_header.hMon Apr 18 06:32:24 2016
> (r298186)
> +++ head/sys/netinet/sctp_header.hMon Apr 18 06:38:53 2016
> (r298187)
> @@ -160,7 +160,7 @@ struct sctp_idata {
>   union {
>   uint32_t protocol_id;
>   uint32_t fsn;   /* Fragment Sequence Number */
> - };
> + } ppid_fsn;
>   /* user data follows */
>  }  SCTP_PACKED;
>  
> 
> Modified: head/sys/netinet/sctp_indata.c
> =
> =
> --- head/sys/netinet/sctp_indata.cMon Apr 18 06:32:24 2016
> (r298186)
> +++ head/sys/netinet/sctp_indata.cMon Apr 18 06:38:53 2016
> (r298187)
> @@ -1558,7 +1558,7 @@ sctp_process_a_data_chunk(struct sctp_tc
>   if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG)
>   fsn = 0;
>   else
> - fsn = ntohl(nch->dp.fsn);
> + fsn = ntohl(nch->dp.ppid_fsn.fsn);
>   old_data = 0;
>   } else {
>   ch = (struct sctp_data_chunk *)sctp_m_getptr(*m,
> offset,
> 
> Modified: head/sys/netinet/sctp_output.c
> =
> =
> --- head/sys/netinet/sctp_output.cMon Apr 18 06:32:24 2016
> (r298186)
> +++ head/sys/netinet/sctp_output.cMon Apr 18 06:38:53 2016
> (r298187)
> @@ -7641,9 +7641,9 @@ dont_do_it:
>   ndchkh->dp.reserved = htons(0);
>   ndchkh->dp.msg_id = htonl(sp->msg_id);
>   if (sp->fsn == 0)
> - ndchkh->dp.protocol_id = chk
> ->rec.data.payloadtype;
> + ndchkh->dp.ppid_fsn.protocol_id = chk
> ->rec.data.payloadtype;
>   else
> - ndchkh->dp.fsn = htonl(sp->fsn);
> + ndchkh->dp.ppid_fsn.fsn = htonl(sp->fsn);
>   sp->fsn++;
>   ndchkh->ch.chunk_length = htons(chk->send_size);
>   }
> 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298214 - head/lib/libipsec

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 15:08:31 2016
New Revision: 298214
URL: https://svnweb.freebsd.org/changeset/base/298214

Log:
  libipsec: use NULL instead of zero for pointers.

Modified:
  head/lib/libipsec/pfkey.c

Modified: head/lib/libipsec/pfkey.c
==
--- head/lib/libipsec/pfkey.c   Mon Apr 18 15:05:48 2016(r298213)
+++ head/lib/libipsec/pfkey.c   Mon Apr 18 15:08:31 2016(r298214)
@@ -1645,7 +1645,7 @@ pfkey_recv(so)
 
/* read real message */
reallen = PFKEY_UNUNIT64(buf.sadb_msg_len);
-   if ((newmsg = CALLOC(reallen, struct sadb_msg *)) == 0) {
+   if ((newmsg = CALLOC(reallen, struct sadb_msg *)) == NULL) {
__ipsec_set_strerror(strerror(errno));
return NULL;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298213 - head/libexec/rbootd

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 15:05:48 2016
New Revision: 298213
URL: https://svnweb.freebsd.org/changeset/base/298213

Log:
  rbootd: use NULL instead of zero for pointers.

Modified:
  head/libexec/rbootd/bpf.c

Modified: head/libexec/rbootd/bpf.c
==
--- head/libexec/rbootd/bpf.c   Mon Apr 18 15:01:59 2016(r298212)
+++ head/libexec/rbootd/bpf.c   Mon Apr 18 15:05:48 2016(r298213)
@@ -241,7 +241,7 @@ BpfGetIntfName(char **errmsg)
ifrp = ibuf;
ifend = (struct ifreq *)((char *)ibuf + ifc.ifc_len);
 
-   mp = 0;
+   mp = NULL;
minunit = 666;
for (; ifrp < ifend; ++ifrp) {
if (ioctl(fd, SIOCGIFFLAGS, (char *)ifrp) < 0) {
@@ -271,7 +271,7 @@ BpfGetIntfName(char **errmsg)
}
 
(void) close(fd);
-   if (mp == 0) {
+   if (mp == NULL) {
(void) strcpy(errbuf, "bpf: no interfaces found");
return(NULL);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298208 - head/lib/libbluetooth

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 14:41:30 2016
New Revision: 298208
URL: https://svnweb.freebsd.org/changeset/base/298208

Log:
  libbluetooth: use NULL instead of zero for pointers.

Modified:
  head/lib/libbluetooth/bluetooth.c

Modified: head/lib/libbluetooth/bluetooth.c
==
--- head/lib/libbluetooth/bluetooth.c   Mon Apr 18 14:37:26 2016
(r298207)
+++ head/lib/libbluetooth/bluetooth.c   Mon Apr 18 14:41:30 2016
(r298208)
@@ -67,7 +67,7 @@ bt_gethostbyname(char const *name)
while ((p = bt_gethostent()) != NULL) {
if (strcasecmp(p->h_name, name) == 0)
break;
-   for (cp = p->h_aliases; *cp != 0; cp++)
+   for (cp = p->h_aliases; *cp != NULL; cp++)
if (strcasecmp(*cp, name) == 0)
goto found;
}
@@ -180,7 +180,7 @@ bt_getprotobyname(char const *name)
while ((p = bt_getprotoent()) != NULL) {
if (strcmp(p->p_name, name) == 0)
break;
-   for (cp = p->p_aliases; *cp != 0; cp++)
+   for (cp = p->p_aliases; *cp != NULL; cp++)
if (strcmp(*cp, name) == 0)
goto found;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298210 - head/lib/libstand

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 14:45:56 2016
New Revision: 298210
URL: https://svnweb.freebsd.org/changeset/base/298210

Log:
  libstand: use NULL instead of zero for pointers.

Modified:
  head/lib/libstand/cd9660.c
  head/lib/libstand/nfs.c
  head/lib/libstand/strtol.c

Modified: head/lib/libstand/cd9660.c
==
--- head/lib/libstand/cd9660.c  Mon Apr 18 14:44:01 2016(r298209)
+++ head/lib/libstand/cd9660.c  Mon Apr 18 14:45:56 2016(r298210)
@@ -273,13 +273,13 @@ dirmatch(struct open_file *f, const char
 static int
 cd9660_open(const char *path, struct open_file *f)
 {
-   struct file *fp = 0;
+   struct file *fp = NULL;
void *buf;
struct iso_primary_descriptor *vd;
size_t buf_size, read, dsize, off;
daddr_t bno, boff;
struct iso_directory_record rec;
-   struct iso_directory_record *dp = 0;
+   struct iso_directory_record *dp = NULL;
int rc, first, use_rrip, lenskip;
 
/* First find the volume descriptor */
@@ -415,7 +415,7 @@ cd9660_close(struct open_file *f)
 {
struct file *fp = (struct file *)f->f_fsdata;
 
-   f->f_fsdata = 0;
+   f->f_fsdata = NULL;
free(fp);
 
return 0;

Modified: head/lib/libstand/nfs.c
==
--- head/lib/libstand/nfs.c Mon Apr 18 14:44:01 2016(r298209)
+++ head/lib/libstand/nfs.c Mon Apr 18 14:45:56 2016(r298210)
@@ -511,7 +511,7 @@ nfs_open(const char *upath, struct open_
 
 #ifndef NFS_NOSYMLINK
bcopy(_root_node, currfd, sizeof(*currfd));
-   newfd = 0;
+   newfd = NULL;
 
cp = path = strdup(upath);
if (path == NULL) {
@@ -593,14 +593,14 @@ nfs_open(const char *upath, struct open_
bcopy(_root_node, currfd, sizeof(*currfd));
 
free(newfd);
-   newfd = 0;
+   newfd = NULL;
 
continue;
}
 
free(currfd);
currfd = newfd;
-   newfd = 0;
+   newfd = NULL;
}
 
error = 0;
@@ -1155,7 +1155,7 @@ nfs_open(const char *upath, struct open_
}
 #ifndef NFS_NOSYMLINK
bcopy(_root_node, currfd, sizeof(*currfd));
-   newfd = 0;
+   newfd = NULL;
 
cp = path = strdup(upath);
if (path == NULL) {
@@ -1241,14 +1241,14 @@ nfs_open(const char *upath, struct open_
bcopy(_root_node, currfd, sizeof(*currfd));
 
free(newfd);
-   newfd = 0;
+   newfd = NULL;
 
continue;
}
 
free(currfd);
currfd = newfd;
-   newfd = 0;
+   newfd = NULL;
}
 
error = 0;

Modified: head/lib/libstand/strtol.c
==
--- head/lib/libstand/strtol.c  Mon Apr 18 14:44:01 2016(r298209)
+++ head/lib/libstand/strtol.c  Mon Apr 18 14:45:56 2016(r298210)
@@ -126,7 +126,7 @@ strtol(nptr, endptr, base)
errno = ERANGE;
} else if (neg)
acc = -acc;
-   if (endptr != 0)
+   if (endptr != NULL)
*endptr = (char *)(any ? s - 1 : nptr);
return (acc);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298209 - head/usr.bin/finger

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 14:44:01 2016
New Revision: 298209
URL: https://svnweb.freebsd.org/changeset/base/298209

Log:
  Use NULL instead of 0 for pointers.
  
  strchr(3) will return NULL if the character does not appear in the
  string.
  
  MFC after:2 weeks.

Modified:
  head/usr.bin/finger/net.c

Modified: head/usr.bin/finger/net.c
==
--- head/usr.bin/finger/net.c   Mon Apr 18 14:41:30 2016(r298208)
+++ head/usr.bin/finger/net.c   Mon Apr 18 14:44:01 2016(r298209)
@@ -68,7 +68,7 @@ netfinger(char *name)
static struct addrinfo hint;
 
host = strrchr(name, '@');
-   if (host == 0)
+   if (host == NULL)
return;
*host++ = '\0';
signal(SIGALRM, cleanup);
@@ -92,7 +92,7 @@ netfinger(char *name)
else
printf("[%s]\n", ai0->ai_canonname);
 
-   for (ai = ai0; ai != 0; ai = ai->ai_next) {
+   for (ai = ai0; ai != NULL; ai = ai->ai_next) {
if (multi)
trying(ai);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298207 - head/lib/libcompat/4.3

2016-04-18 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Apr 18 14:37:26 2016
New Revision: 298207
URL: https://svnweb.freebsd.org/changeset/base/298207

Log:
  rexec(3): use NULL instead of zero for pointers.

Modified:
  head/lib/libcompat/4.3/rexec.c

Modified: head/lib/libcompat/4.3/rexec.c
==
--- head/lib/libcompat/4.3/rexec.c  Mon Apr 18 14:12:42 2016
(r298206)
+++ head/lib/libcompat/4.3/rexec.c  Mon Apr 18 14:37:26 2016
(r298207)
@@ -187,7 +187,7 @@ next:
 
case LOGIN:
if (token())
-   if (*aname == 0) {
+   if (*aname == NULL) {
*aname = malloc((unsigned) 
strlen(tokval) + 1);
(void) strcpy(*aname, tokval);
} else {
@@ -196,14 +196,14 @@ next:
}
break;
case PASSWD:
-   if ((*aname == 0 || strcmp(*aname, "anonymous")) &&
+   if ((*aname == NULL || strcmp(*aname, "anonymous")) &&
fstat(fileno(cfile), ) >= 0 &&
(stb.st_mode & 077) != 0) {
warnx("Error: .netrc file is readable by others.");
warnx("Remove password or make file unreadable by others.");
goto bad;
}
-   if (token() && *apass == 0) {
+   if (token() && *apass == NULL) {
*apass = malloc((unsigned) strlen(tokval) + 1);
(void) strcpy(*apass, tokval);
}
@@ -215,7 +215,7 @@ next:
warnx("Remove account or make file unreadable by others.");
goto bad;
}
-   if (token() && *aacct == 0) {
+   if (token() && *aacct == NULL) {
*aacct = malloc((unsigned) strlen(tokval) + 1);
(void) strcpy(*aacct, tokval);
}
@@ -305,7 +305,7 @@ rexec(ahost, rport, name, pass, cmd, fd2
char c, *acct;
 
hp = gethostbyname(*ahost);
-   if (hp == 0) {
+   if (hp == NULL) {
herror(*ahost);
return (-1);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298206 - head/sbin/ifconfig

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 14:12:42 2016
New Revision: 298206
URL: https://svnweb.freebsd.org/changeset/base/298206

Log:
  User NULL instead of 0 for pointers.
  
  gethostbyname(3) will return NULL in case of an error.
  
  MFC after:2 weeks.

Modified:
  head/sbin/ifconfig/af_inet.c

Modified: head/sbin/ifconfig/af_inet.c
==
--- head/sbin/ifconfig/af_inet.cMon Apr 18 14:08:35 2016
(r298205)
+++ head/sbin/ifconfig/af_inet.cMon Apr 18 14:12:42 2016
(r298206)
@@ -133,10 +133,10 @@ in_getaddr(const char *s, int which)
 
if (inet_aton(s, >sin_addr))
return;
-   if ((hp = gethostbyname(s)) != 0)
+   if ((hp = gethostbyname(s)) != NULL)
bcopy(hp->h_addr, (char *)>sin_addr, 
MIN((size_t)hp->h_length, sizeof(sin->sin_addr)));
-   else if ((np = getnetbyname(s)) != 0)
+   else if ((np = getnetbyname(s)) != NULL)
sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY);
else
errx(1, "%s: bad value", s);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298205 - in head/sbin: growfs newfs restore

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 14:08:35 2016
New Revision: 298205
URL: https://svnweb.freebsd.org/changeset/base/298205

Log:
  Use NULL instead of 0 for pointers.
  
  strchr(3) will return NULL if the character does not appear in the
  string.
  
  MFC after:2 weeks.

Modified:
  head/sbin/growfs/growfs.c
  head/sbin/newfs/newfs.c
  head/sbin/restore/utilities.c

Modified: head/sbin/growfs/growfs.c
==
--- head/sbin/growfs/growfs.c   Mon Apr 18 13:13:59 2016(r298204)
+++ head/sbin/growfs/growfs.c   Mon Apr 18 14:08:35 2016(r298205)
@@ -1331,7 +1331,7 @@ getdev(const char *name)
return (name);
 
cp = strrchr(name, '/');
-   if (cp == 0) {
+   if (cp == NULL) {
snprintf(device, sizeof(device), "%s%s", _PATH_DEV, name);
if (is_dev(device))
return (device);

Modified: head/sbin/newfs/newfs.c
==
--- head/sbin/newfs/newfs.c Mon Apr 18 13:13:59 2016(r298204)
+++ head/sbin/newfs/newfs.c Mon Apr 18 14:08:35 2016(r298205)
@@ -306,7 +306,7 @@ main(int argc, char *argv[])
if (!special[0])
err(1, "empty file/special name");
cp = strrchr(special, '/');
-   if (cp == 0) {
+   if (cp == NULL) {
/*
 * No path prefix; try prefixing _PATH_DEV.
 */

Modified: head/sbin/restore/utilities.c
==
--- head/sbin/restore/utilities.c   Mon Apr 18 13:13:59 2016
(r298204)
+++ head/sbin/restore/utilities.c   Mon Apr 18 14:08:35 2016
(r298205)
@@ -62,7 +62,7 @@ pathcheck(char *name)
char *start;
 
start = strchr(name, '/');
-   if (start == 0)
+   if (start == NULL)
return;
for (cp = start; *cp != '\0'; cp++) {
if (*cp != '/')
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298204 - in head: lib/libdwarf lib/libelf lib/libelftc usr.bin/addr2line usr.bin/cxxfilt usr.bin/elfcopy usr.bin/nm usr.bin/readelf usr.bin/size usr.bin/strings

2016-04-18 Thread Ed Maste
Author: emaste
Date: Mon Apr 18 13:13:59 2016
New Revision: 298204
URL: https://svnweb.freebsd.org/changeset/base/298204

Log:
  Replace ${CURDIR}/../.. with ${CURDIR:H:H} in elftoolchain
  
  This produces a nicer path in debug info and build logs.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libdwarf/Makefile
  head/lib/libelf/Makefile
  head/lib/libelftc/Makefile
  head/usr.bin/addr2line/Makefile
  head/usr.bin/cxxfilt/Makefile
  head/usr.bin/elfcopy/Makefile
  head/usr.bin/nm/Makefile
  head/usr.bin/readelf/Makefile
  head/usr.bin/size/Makefile
  head/usr.bin/strings/Makefile

Modified: head/lib/libdwarf/Makefile
==
--- head/lib/libdwarf/Makefile  Mon Apr 18 11:39:41 2016(r298203)
+++ head/lib/libdwarf/Makefile  Mon Apr 18 13:13:59 2016(r298204)
@@ -2,7 +2,7 @@
 .include 
 
 PACKAGE=lib${LIB}
-TOP=   ${.CURDIR}/../../contrib/elftoolchain
+TOP=   ${.CURDIR:H:H}/contrib/elftoolchain
 SRCDIR=${TOP}/libdwarf
 
 .PATH: ${SRCDIR}

Modified: head/lib/libelf/Makefile
==
--- head/lib/libelf/MakefileMon Apr 18 11:39:41 2016(r298203)
+++ head/lib/libelf/MakefileMon Apr 18 13:13:59 2016(r298204)
@@ -5,7 +5,7 @@ SHLIBDIR?= /lib
 
 .include 
 
-TOP=   ${.CURDIR}/../../contrib/elftoolchain
+TOP=   ${.CURDIR:H:H}/contrib/elftoolchain
 SRCDIR=${TOP}/libelf
 
 .PATH: ${SRCDIR}

Modified: head/lib/libelftc/Makefile
==
--- head/lib/libelftc/Makefile  Mon Apr 18 11:39:41 2016(r298203)
+++ head/lib/libelftc/Makefile  Mon Apr 18 13:13:59 2016(r298204)
@@ -4,7 +4,7 @@
 PACKAGE=lib${LIB}
 INTERNALLIB=
 
-ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
 
 .PATH: ${ELFTCDIR}/libelftc
 

Modified: head/usr.bin/addr2line/Makefile
==
--- head/usr.bin/addr2line/Makefile Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/addr2line/Makefile Mon Apr 18 13:13:59 2016
(r298204)
@@ -2,7 +2,7 @@
 
 .include 
 
-ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
 ADDR2LINEDIR=  ${ELFTCDIR}/addr2line
 
 .PATH: ${ADDR2LINEDIR}

Modified: head/usr.bin/cxxfilt/Makefile
==
--- head/usr.bin/cxxfilt/Makefile   Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/cxxfilt/Makefile   Mon Apr 18 13:13:59 2016
(r298204)
@@ -2,7 +2,7 @@
 
 .include 
 
-ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
 SRCDIR=${ELFTCDIR}/cxxfilt
 
 .PATH: ${SRCDIR}

Modified: head/usr.bin/elfcopy/Makefile
==
--- head/usr.bin/elfcopy/Makefile   Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/elfcopy/Makefile   Mon Apr 18 13:13:59 2016
(r298204)
@@ -2,7 +2,7 @@
 
 .include 
 
-ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
 ELFCOPYDIR=${ELFTCDIR}/elfcopy
 
 .PATH: ${ELFCOPYDIR}

Modified: head/usr.bin/nm/Makefile
==
--- head/usr.bin/nm/MakefileMon Apr 18 11:39:41 2016(r298203)
+++ head/usr.bin/nm/MakefileMon Apr 18 13:13:59 2016(r298204)
@@ -2,7 +2,7 @@
 
 .include 
 
-ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
 NMDIR= ${ELFTCDIR}/nm
 
 .PATH: ${NMDIR}

Modified: head/usr.bin/readelf/Makefile
==
--- head/usr.bin/readelf/Makefile   Mon Apr 18 11:39:41 2016
(r298203)
+++ head/usr.bin/readelf/Makefile   Mon Apr 18 13:13:59 2016
(r298204)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
 READELFDIR=${ELFTCDIR}/readelf
 
 .PATH: ${READELFDIR}

Modified: head/usr.bin/size/Makefile
==
--- head/usr.bin/size/Makefile  Mon Apr 18 11:39:41 2016(r298203)
+++ head/usr.bin/size/Makefile  Mon Apr 18 13:13:59 2016(r298204)
@@ -2,7 +2,7 @@
 
 .include 
 
-ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+ELFTCDIR=  ${.CURDIR:H:H}/contrib/elftoolchain
 SIZEDIR=   ${ELFTCDIR}/size
 
 .PATH: ${SIZEDIR}

Modified: head/usr.bin/strings/Makefile
==
--- head/usr.bin/strings/Makefile   

svn commit: r298203 - head/sys/netinet

2016-04-18 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 18 11:39:41 2016
New Revision: 298203
URL: https://svnweb.freebsd.org/changeset/base/298203

Log:
  Fix signed/unsigned warnings.

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Mon Apr 18 10:37:50 2016
(r298202)
+++ head/sys/netinet/sctp_indata.c  Mon Apr 18 11:39:41 2016
(r298203)
@@ -2598,7 +2598,7 @@ sctp_process_data(struct mbuf **mm, int 
} else {
clen = sizeof(struct sctp_idata_chunk);
}
-   if ((size_t)chk_length < clen) {
+   if (chk_length < clen) {
/*
 * Need to send an abort since we had a
 * invalid data chunk.

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Mon Apr 18 10:37:50 2016
(r298202)
+++ head/sys/netinet/sctp_output.c  Mon Apr 18 11:39:41 2016
(r298203)
@@ -7186,7 +7186,8 @@ sctp_move_to_outqueue(struct sctp_tcb *s
struct sctp_tmit_chunk *chk;
struct sctp_data_chunk *dchkh = NULL;
struct sctp_idata_chunk *ndchkh = NULL;
-   uint32_t to_move, length, leading;
+   uint32_t to_move, length;
+   int leading;
uint8_t rcv_flags = 0;
uint8_t some_taken;
uint8_t send_lock_up = 0;
@@ -7491,9 +7492,9 @@ dont_do_it:
atomic_subtract_int(>length, to_move);
}
if (stcb->asoc.idata_supported == 0) {
-   leading = (int)sizeof(struct sctp_data_chunk);
+   leading = sizeof(struct sctp_data_chunk);
} else {
-   leading = (int)sizeof(struct sctp_idata_chunk);
+   leading = sizeof(struct sctp_idata_chunk);
}
if (M_LEADINGSPACE(chk->data) < leading) {
/* Not enough room for a chunk header, get some */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298202 - head/sys/dev/pci

2016-04-18 Thread Andrew Turner
Author: andrew
Date: Mon Apr 18 10:37:50 2016
New Revision: 298202
URL: https://svnweb.freebsd.org/changeset/base/298202

Log:
  Pull the MSI/MSI-X handling functions out to help with INTRNG integration.
  
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/pci/pci_host_generic.c

Modified: head/sys/dev/pci/pci_host_generic.c
==
--- head/sys/dev/pci/pci_host_generic.c Mon Apr 18 09:56:41 2016
(r298201)
+++ head/sys/dev/pci/pci_host_generic.c Mon Apr 18 10:37:50 2016
(r298202)
@@ -656,6 +656,63 @@ generic_pcie_deactivate_resource(device_
return (res);
 }
 
+static int
+generic_pcie_alloc_msi(device_t pci, device_t child, int count, int maxcount,
+int *irqs)
+{
+
+#if defined(__aarch64__)
+   return (arm_alloc_msi(pci, child, count, maxcount, irqs));
+#else
+   return (ENXIO);
+#endif
+}
+
+static int
+generic_pcie_release_msi(device_t pci, device_t child, int count, int *irqs)
+{
+
+#if defined(__aarch64__)
+   return (arm_release_msi(pci, child, count, irqs));
+#else
+   return (ENXIO);
+#endif
+}
+
+static int
+generic_pcie_map_msi(device_t pci, device_t child, int irq, uint64_t *addr,
+uint32_t *data)
+{
+
+#if defined(__aarch64__)
+   return (arm_map_msi(pci, child, irq, addr, data));
+#else
+   return (ENXIO);
+#endif
+}
+
+static int
+generic_pcie_alloc_msix(device_t pci, device_t child, int *irq)
+{
+
+#if defined(__aarch64__)
+   return (arm_alloc_msix(pci, child, irq));
+#else
+   return (ENXIO);
+#endif
+}
+
+static int
+generic_pcie_release_msix(device_t pci, device_t child, int irq)
+{
+
+#if defined(__aarch64__)
+   return (arm_release_msix(pci, child, irq));
+#else
+   return (ENXIO);
+#endif
+}
+
 static device_method_t generic_pcie_methods[] = {
DEVMETHOD(device_probe, generic_pcie_probe),
DEVMETHOD(device_attach,pci_host_generic_attach),
@@ -674,13 +731,11 @@ static device_method_t generic_pcie_meth
DEVMETHOD(pcib_route_interrupt, generic_pcie_route_interrupt),
DEVMETHOD(pcib_read_config, generic_pcie_read_config),
DEVMETHOD(pcib_write_config,generic_pcie_write_config),
-#if defined(__aarch64__)
-   DEVMETHOD(pcib_alloc_msi,   arm_alloc_msi),
-   DEVMETHOD(pcib_release_msi, arm_release_msi),
-   DEVMETHOD(pcib_alloc_msix,  arm_alloc_msix),
-   DEVMETHOD(pcib_release_msix,arm_release_msix),
-   DEVMETHOD(pcib_map_msi, arm_map_msi),
-#endif
+   DEVMETHOD(pcib_alloc_msi,   generic_pcie_alloc_msi),
+   DEVMETHOD(pcib_release_msi, generic_pcie_release_msi),
+   DEVMETHOD(pcib_alloc_msix,  generic_pcie_alloc_msix),
+   DEVMETHOD(pcib_release_msix,generic_pcie_release_msix),
+   DEVMETHOD(pcib_map_msi, generic_pcie_map_msi),
 
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo,  generic_pcie_ofw_get_devinfo),
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298201 - head/lib/libc/stdlib

2016-04-18 Thread Sergey Kandaurov
Author: pluknet
Date: Mon Apr 18 09:56:41 2016
New Revision: 298201
URL: https://svnweb.freebsd.org/changeset/base/298201

Log:
  Fixed indentation, minor style.

Modified:
  head/lib/libc/stdlib/qsort.3

Modified: head/lib/libc/stdlib/qsort.3
==
--- head/lib/libc/stdlib/qsort.3Mon Apr 18 09:39:46 2016
(r298200)
+++ head/lib/libc/stdlib/qsort.3Mon Apr 18 09:56:41 2016
(r298201)
@@ -252,16 +252,16 @@ and then prints the sorted array to stan
 #include 
 
 /*
- * Custom comparison function that can compare 'int' values through pointers
+ * Custom comparison function that compares 'int' values through pointers
  * passed by qsort(3).
  */
 static int
 int_compare(const void *p1, const void *p2)
 {
-int left = *(const int *)p1;
-int right = *(const int *)p2;
+   int left = *(const int *)p1;
+   int right = *(const int *)p2;
 
-return ((left > right) - (left < right));
+   return ((left > right) - (left < right));
 }
 
 /*
@@ -270,15 +270,15 @@ int_compare(const void *p1, const void *
 int
 main(void)
 {
-   int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 };
-   const size_t array_size = sizeof(int_array) / sizeof(int_array[0]);
-   size_t k;
+   int int_array[] = { 4, 5, 9, 3, 0, 1, 7, 2, 8, 6 };
+   size_t array_size = sizeof(int_array) / sizeof(int_array[0]);
+   size_t k;
 
-   qsort(_array, array_size, sizeof(int_array[0]), int_compare);
-   for (k = 0; k < array_size; k++)
-printf(" %d", int_array[k]);
-puts("");
-return (EXIT_SUCCESS);
+   qsort(_array, array_size, sizeof(int_array[0]), int_compare);
+   for (k = 0; k < array_size; k++)
+   printf(" %d", int_array[k]);
+   puts("");
+   return (EXIT_SUCCESS);
 }
 .Ed
 .Sh COMPATIBILITY
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298200 - head/sys/netinet

2016-04-18 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 18 09:39:46 2016
New Revision: 298200
URL: https://svnweb.freebsd.org/changeset/base/298200

Log:
  Fix a warning about an unused variable.

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Mon Apr 18 09:29:14 2016
(r298199)
+++ head/sys/netinet/sctp_indata.c  Mon Apr 18 09:39:46 2016
(r298200)
@@ -1288,7 +1288,7 @@ sctp_queue_data_for_reasm(struct sctp_tc
}
}
}
-   if ((asoc->idata_supported == 0) && ((control->sinfo_flags >> 8) & 
SCTP_DATA_UNORDERED)) {
+   if ((asoc->idata_supported == 0) && (unordered == 1)) {
sctp_inject_old_data_unordered(stcb, asoc, strm, control, chk, 
abort_flag);
return;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298199 - head/sys/netinet

2016-04-18 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 18 09:29:14 2016
New Revision: 298199
URL: https://svnweb.freebsd.org/changeset/base/298199

Log:
  Put panic() calls under INVARIANTS.

Modified:
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Mon Apr 18 08:30:52 2016
(r298198)
+++ head/sys/netinet/sctp_indata.c  Mon Apr 18 09:29:14 2016
(r298199)
@@ -570,9 +570,11 @@ protocol_error:
sctp_ucount_decr(asoc->cnt_on_all_streams);
if (control->on_strm_q == SCTP_ON_ORDERED) {
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
+#ifdef INVARIANTS
} else {
panic("Huh control: %p is on_strm_q: 
%d",
control, control->on_strm_q);
+#endif
}
control->on_strm_q = 0;
strm->last_sequence_delivered++;
@@ -674,7 +676,11 @@ sctp_add_to_tail_pointer(struct sctp_que
 
stcb = control->stcb;
if (stcb == NULL) {
+#ifdef INVARIANTS
panic("Control broken");
+#else
+   return;
+#endif
}
if (control->tail_mbuf == NULL) {
/* TSNH */
@@ -1020,10 +1026,12 @@ sctp_deliver_reasm_check(struct sctp_tcb
if (control->end_added) {
/* We just put the last bit on */
if (control->on_strm_q) {
+#ifdef INVARIANTS
if (control->on_strm_q != SCTP_ON_UNORDERED) {
panic("Huh control: %p on_q: %d -- not 
unordered?",
control, control->on_strm_q);
}
+#endif
TAILQ_REMOVE(>uno_inqueue, control, 
next_instrm);
control->on_strm_q = 0;
}
@@ -1072,10 +1080,12 @@ done_un:
strm->last_sequence_delivered);
if (control->end_added) {
if (control->on_strm_q) {
+#ifdef INVARIANTS
if (control->on_strm_q != SCTP_ON_ORDERED) {
panic("Huh control: %p on_q: %d -- not 
ordered?",
control, control->on_strm_q);
}
+#endif
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
control->on_strm_q = 0;
}
@@ -1113,10 +1123,12 @@ deliver_more:
if (control->end_added) {
/* We are done with it afterwards */
if (control->on_strm_q) {
+#ifdef INVARIANTS
if (control->on_strm_q != 
SCTP_ON_ORDERED) {
panic("Huh control: %p on_q: %d 
-- not ordered?",
control, 
control->on_strm_q);
}
+#endif
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
control->on_strm_q = 0;
}
@@ -1210,9 +1222,11 @@ sctp_add_chk_to_control(struct sctp_queu
/* Ordered */
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
control->on_strm_q = 0;
+#ifdef INVARIANTS
} else if (control->on_strm_q) {
panic("Unknown state on ctrl: %p on_strm_q: 
%d", control,
control->on_strm_q);
+#endif
}
}
control->end_added = 1;
@@ -5167,9 +5181,11 @@ sctp_kick_prsctp_reorder_queue(struct sc
TAILQ_REMOVE(>inqueue, 
ctl, next_instrm);
} else if (ctl->on_strm_q == 
SCTP_ON_UNORDERED) {

TAILQ_REMOVE(>uno_inqueue, ctl, next_instrm);
+#ifdef INVARIANTS
} else {
panic("strmin: %p ctl: %p 
unknown %d",
strmin, ctl, 
ctl->on_strm_q);
+#endif
}
ctl->on_strm_q = 0;
}
@@ -5230,9 +5246,11 @@ sctp_kick_prsctp_reorder_queue(struct sc

svn commit: r298197 - head/sys/cam

2016-04-18 Thread Xin LI
Author: delphij
Date: Mon Apr 18 08:24:13 2016
New Revision: 298197
URL: https://svnweb.freebsd.org/changeset/base/298197

Log:
  Fix tinderbox LINT build.

Modified:
  head/sys/cam/cam_iosched.c

Modified: head/sys/cam/cam_iosched.c
==
--- head/sys/cam/cam_iosched.c  Mon Apr 18 07:48:27 2016(r298196)
+++ head/sys/cam/cam_iosched.c  Mon Apr 18 08:24:13 2016(r298197)
@@ -63,7 +63,6 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/
 
 #ifdef CAM_NETFLIX_IOSCHED
 
-SYSCTL_DECL(_kern_cam);
 static int do_netflix_iosched = 1;
 TUNABLE_INT("kern.cam.do_netflix_iosched", _netflix_iosched);
 SYSCTL_INT(_kern_cam, OID_AUTO, do_netflix_iosched, CTLFLAG_RD,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298196 - head/tests/sys/file

2016-04-18 Thread Garrett Cooper
Author: ngie
Date: Mon Apr 18 07:48:27 2016
New Revision: 298196
URL: https://svnweb.freebsd.org/changeset/base/298196

Log:
  Minor cosmetic cleanup
  
  - Remove spurious trailing whitespace in licensing header
  - Remove unnecessary semi-colon after comment [*]
  
  MFC after: 3 days
  Submitted by: pfg [*]
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tests/sys/file/newfileops_on_fork_test.c

Modified: head/tests/sys/file/newfileops_on_fork_test.c
==
--- head/tests/sys/file/newfileops_on_fork_test.c   Mon Apr 18 07:47:26 
2016(r298195)
+++ head/tests/sys/file/newfileops_on_fork_test.c   Mon Apr 18 07:48:27 
2016(r298196)
@@ -3,7 +3,7 @@
  * All rights reserved.
  *
  * This software was developed at the University of Cambridge Computer
- * Laboratory with support from a grant from Google, Inc. 
+ * Laboratory with support from a grant from Google, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -115,7 +115,7 @@ main(__unused int argc, __unused char *a
err(-1, "listen");
if (pthread_create(_thread, NULL, do_accept, NULL) != 0)
err(-1, "pthread_create");
-   sleep(1);   /* Easier than using a CV. */;
+   sleep(1);   /* Easier than using a CV. */
do_fork();
exit(0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298195 - head/sbin/fsdb

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 07:47:26 2016
New Revision: 298195
URL: https://svnweb.freebsd.org/changeset/base/298195

Log:
  Use NULL instead of 0 for pointers.
  
  malloc will return NULL if it cannot allocate memory.
  
  MFC after:2 weeks.

Modified:
  head/sbin/fsdb/fsdbutil.c

Modified: head/sbin/fsdb/fsdbutil.c
==
--- head/sbin/fsdb/fsdbutil.c   Mon Apr 18 07:44:53 2016(r298194)
+++ head/sbin/fsdb/fsdbutil.c   Mon Apr 18 07:47:26 2016(r298195)
@@ -310,7 +310,7 @@ printblocks(ino_t inum, union dinode *dp
return;
 
 bufp = malloc((unsigned int)sblock.fs_bsize);
-if (bufp == 0)
+if (bufp == NULL)
errx(EEXIT, "cannot allocate indirect block buffer");
 printf("Indirect blocks:\n");
 for (i = 0; i < NIADDR; i++)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298194 - head/sbin/fsck

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 07:44:53 2016
New Revision: 298194
URL: https://svnweb.freebsd.org/changeset/base/298194

Log:
  strchr(3) will return NULL if it cannot find the character in the
  string.
  getfsent(3) will return NULL on EOF or error.
  
  MFC after:2 weeks.

Modified:
  head/sbin/fsck/fsck.c
  head/sbin/fsck/preen.c

Modified: head/sbin/fsck/fsck.c
==
--- head/sbin/fsck/fsck.c   Mon Apr 18 07:40:36 2016(r298193)
+++ head/sbin/fsck/fsck.c   Mon Apr 18 07:44:53 2016(r298194)
@@ -200,7 +200,7 @@ main(int argc, char *argv[])
mntpt = NULL;
spec = *argv;
cp = strrchr(spec, '/');
-   if (cp == 0) {
+   if (cp == NULL) {
(void)snprintf(device, sizeof(device), "%s%s",
_PATH_DEV, spec);
spec = device;

Modified: head/sbin/fsck/preen.c
==
--- head/sbin/fsck/preen.c  Mon Apr 18 07:40:36 2016(r298193)
+++ head/sbin/fsck/preen.c  Mon Apr 18 07:44:53 2016(r298194)
@@ -106,7 +106,7 @@ checkfstab(int flags, int (*docheck)(str
warnx("Can't open checklist file: %s\n", _PATH_FSTAB);
return (8);
}
-   while ((fs = getfsent()) != 0) {
+   while ((fs = getfsent()) != NULL) {
name = fs->fs_spec;
if (fs->fs_passno > passno && fs->fs_passno < nextpass)
nextpass = fs->fs_passno;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298193 - head/sbin/bsdlabel

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 07:40:36 2016
New Revision: 298193
URL: https://svnweb.freebsd.org/changeset/base/298193

Log:
  Use NULL instead of 0 for pointers.
  
  strchr(3) will return NULL if the character does not appear in the
  string.
  
  MFC after:2 weeks.

Modified:
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/bsdlabel.c
==
--- head/sbin/bsdlabel/bsdlabel.c   Mon Apr 18 07:36:24 2016
(r298192)
+++ head/sbin/bsdlabel/bsdlabel.c   Mon Apr 18 07:40:36 2016
(r298193)
@@ -781,7 +781,7 @@ getasciilabel(FILE *f, struct disklabel 
lp->d_sbsize = 0;   /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {
lineno++;
-   if ((cp = strchr(line,'\n')) != 0)
+   if ((cp = strchr(line,'\n')) != NULL)
*cp = '\0';
cp = skip(line);
if (cp == NULL)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298192 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src lib/libmagic

2016-04-18 Thread Xin LI
Author: delphij
Date: Mon Apr 18 07:36:24 2016
New Revision: 298192
URL: https://svnweb.freebsd.org/changeset/base/298192

Log:
  MFV r298178:
  
  Update file to 5.26.
  
  MFC after:2 weeks
  Relnotes: yes

Added:
  head/contrib/file/magic/Magdir/bioinformatics
 - copied unchanged from r298178, 
vendor/file/dist/magic/Magdir/bioinformatics
  head/contrib/file/magic/Magdir/coff
 - copied unchanged from r298178, vendor/file/dist/magic/Magdir/coff
  head/contrib/file/magic/Magdir/der
 - copied unchanged from r298178, vendor/file/dist/magic/Magdir/der
  head/contrib/file/magic/Magdir/finger
 - copied unchanged from r298178, vendor/file/dist/magic/Magdir/finger
  head/contrib/file/magic/Magdir/flif
 - copied unchanged from r298178, vendor/file/dist/magic/Magdir/flif
  head/contrib/file/magic/Magdir/microfocus
 - copied unchanged from r298178, vendor/file/dist/magic/Magdir/microfocus
  head/contrib/file/magic/Magdir/polyml
 - copied unchanged from r298178, vendor/file/dist/magic/Magdir/polyml
  head/contrib/file/magic/Magdir/vacuum-cleaner
 - copied unchanged from r298178, 
vendor/file/dist/magic/Magdir/vacuum-cleaner
  head/contrib/file/src/der.c
 - copied unchanged from r298178, vendor/file/dist/src/der.c
  head/contrib/file/src/der.h
 - copied unchanged from r298178, vendor/file/dist/src/der.h
  head/contrib/file/src/dprintf.c
 - copied unchanged from r298178, vendor/file/dist/src/dprintf.c
Modified:
  head/contrib/file/ChangeLog
  head/contrib/file/README
  head/contrib/file/config.h.in
  head/contrib/file/configure
  head/contrib/file/configure.ac
  head/contrib/file/doc/file.man
  head/contrib/file/doc/libmagic.man
  head/contrib/file/magic/Magdir/android
  head/contrib/file/magic/Magdir/animation
  head/contrib/file/magic/Magdir/apple
  head/contrib/file/magic/Magdir/archive
  head/contrib/file/magic/Magdir/audio
  head/contrib/file/magic/Magdir/c-lang
  head/contrib/file/magic/Magdir/cafebabe
  head/contrib/file/magic/Magdir/commands
  head/contrib/file/magic/Magdir/compress
  head/contrib/file/magic/Magdir/console
  head/contrib/file/magic/Magdir/database
  head/contrib/file/magic/Magdir/filesystems
  head/contrib/file/magic/Magdir/fonts
  head/contrib/file/magic/Magdir/fortran
  head/contrib/file/magic/Magdir/hitachi-sh
  head/contrib/file/magic/Magdir/images
  head/contrib/file/magic/Magdir/intel
  head/contrib/file/magic/Magdir/java
  head/contrib/file/magic/Magdir/lisp
  head/contrib/file/magic/Magdir/mach
  head/contrib/file/magic/Magdir/macintosh
  head/contrib/file/magic/Magdir/misctools
  head/contrib/file/magic/Magdir/modem
  head/contrib/file/magic/Magdir/msdos
  head/contrib/file/magic/Magdir/msvc
  head/contrib/file/magic/Magdir/msx
  head/contrib/file/magic/Magdir/netbsd
  head/contrib/file/magic/Magdir/psdbms
  head/contrib/file/magic/Magdir/python
  head/contrib/file/magic/Magdir/sendmail
  head/contrib/file/magic/Magdir/sgml
  head/contrib/file/magic/Magdir/sinclair
  head/contrib/file/magic/Magdir/sql
  head/contrib/file/magic/Magdir/terminfo
  head/contrib/file/magic/Magdir/windows
  head/contrib/file/magic/Magdir/wordprocessors
  head/contrib/file/magic/Makefile.am
  head/contrib/file/magic/Makefile.in
  head/contrib/file/python/README
  head/contrib/file/python/magic.py
  head/contrib/file/python/setup.py
  head/contrib/file/src/Makefile.am
  head/contrib/file/src/Makefile.in
  head/contrib/file/src/apprentice.c
  head/contrib/file/src/ascmagic.c
  head/contrib/file/src/compress.c
  head/contrib/file/src/file.c
  head/contrib/file/src/file.h
  head/contrib/file/src/file_opts.h
  head/contrib/file/src/fmtcheck.c
  head/contrib/file/src/funcs.c
  head/contrib/file/src/magic.c
  head/contrib/file/src/magic.h
  head/contrib/file/src/print.c
  head/contrib/file/src/readcdf.c
  head/contrib/file/src/readelf.c
  head/contrib/file/src/readelf.h
  head/contrib/file/src/softmagic.c
  head/lib/libmagic/Makefile
  head/lib/libmagic/config.h
Directory Properties:
  head/contrib/file/   (props changed)

Modified: head/contrib/file/ChangeLog
==
--- head/contrib/file/ChangeLog Mon Apr 18 07:14:01 2016(r298191)
+++ head/contrib/file/ChangeLog Mon Apr 18 07:36:24 2016(r298192)
@@ -1,3 +1,49 @@
+2016-04-16  18:34  Christos Zoulas 
+   
+   * release 5.25
+
+2016-03-31  13:50  Christos Zoulas 
+
+   * make the number of bytes read from files configurable.
+
+2016-03-21  13:40  Christos Zoulas 
+
+   * Add bounds checks for DER code (discovered by Thomas Jarosch)
+   * Change indirect recursion limit to indirect use count and
+ bump from 15 to 50 to prevent abuse.
+
+2016-03-13  20:39  Christos Zoulas 
+
+   * Add -00 which prints filename\0description\0
+
+2016-03-01  13:28  Christos Zoulas 
+
+   * Fix ID3 indirect 

svn commit: r298191 - head/usr.bin/talk

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 07:14:01 2016
New Revision: 298191
URL: https://svnweb.freebsd.org/changeset/base/298191

Log:
  User NULL instead of 0 for pointers.
  
  getservent(3) returns NULL on EOF or error.
  
  MFC after:2 weeks.

Modified:
  head/usr.bin/talk/get_addrs.c

Modified: head/usr.bin/talk/get_addrs.c
==
--- head/usr.bin/talk/get_addrs.c   Mon Apr 18 07:09:34 2016
(r298190)
+++ head/usr.bin/talk/get_addrs.c   Mon Apr 18 07:14:01 2016
(r298191)
@@ -59,7 +59,7 @@ get_addrs(const char *my_machine_name __
err(1, "failed to find my interface address");
/* find the server's port */
sp = getservbyname("ntalk", "udp");
-   if (sp == 0)
+   if (sp == NULL)
errx(1, "ntalk/udp: service is not registered");
daemon_port = sp->s_port;
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298190 - head/usr.bin/m4

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 07:09:34 2016
New Revision: 298190
URL: https://svnweb.freebsd.org/changeset/base/298190

Log:
  Use NULL instead of 0 for pointers.
  
  fopen(3) will return NULL in case it cannot open the STREAM.
  
  MFC after:2 weeks.

Modified:
  head/usr.bin/m4/gnum4.c

Modified: head/usr.bin/m4/gnum4.c
==
--- head/usr.bin/m4/gnum4.c Mon Apr 18 07:05:18 2016(r298189)
+++ head/usr.bin/m4/gnum4.c Mon Apr 18 07:09:34 2016(r298190)
@@ -129,7 +129,7 @@ dopath(struct input_file *i, const char 
 
for (pe = first; pe; pe = pe->next) {
snprintf(path, sizeof(path), "%s/%s", pe->name, filename);
-   if ((f = fopen(path, "r")) != 0) {
+   if ((f = fopen(path, "r")) != NULL) {
set_input(i, f, path);
return i;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298189 - head/usr.bin/find

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 07:05:18 2016
New Revision: 298189
URL: https://svnweb.freebsd.org/changeset/base/298189

Log:
  Use NULL instead of 0 for pointers.
  
  MFC after:2 weeks.

Modified:
  head/usr.bin/find/function.c

Modified: head/usr.bin/find/function.c
==
--- head/usr.bin/find/function.cMon Apr 18 06:58:07 2016
(r298188)
+++ head/usr.bin/find/function.cMon Apr 18 07:05:18 2016
(r298189)
@@ -224,7 +224,7 @@ nextarg(OPTION *option, char ***argvp)
 {
char *arg;
 
-   if ((arg = **argvp) == 0)
+   if ((arg = **argvp) == NULL)
errx(1, "%s: requires additional arguments", option->name);
(*argvp)++;
return arg;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298188 - head/sys/netinet

2016-04-18 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 18 06:58:07 2016
New Revision: 298188
URL: https://svnweb.freebsd.org/changeset/base/298188

Log:
  Cleanup debug output.

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Mon Apr 18 06:38:53 2016
(r298187)
+++ head/sys/netinet/sctp_indata.c  Mon Apr 18 06:58:07 2016
(r298188)
@@ -507,7 +507,7 @@ sctp_queue_data_to_stream(struct sctp_tc
}
if (SCTP_MSGID_GT((!asoc->idata_supported), 
strm->last_sequence_delivered, control->sinfo_ssn)) {
/* The incoming sseq is behind where we last delivered? */
-   SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d 
from peer, Abort association\n",
+   SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ: %u delivered: %u 
from peer, Abort association\n",
control->sinfo_ssn, strm->last_sequence_delivered);
 protocol_error:
/*
@@ -571,7 +571,7 @@ protocol_error:
if (control->on_strm_q == SCTP_ON_ORDERED) {
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
} else {
-   panic("Huh control:%p is on_strm_q:%d",
+   panic("Huh control: %p is on_strm_q: 
%d",
control, control->on_strm_q);
}
control->on_strm_q = 0;
@@ -612,7 +612,7 @@ protocol_error:
struct mbuf *oper;
 
snprintf(msg, sizeof(msg),
-   "Queue to str mid:%d duplicate",
+   "Queue to str msg_id: %u duplicate",
control->msg_id);
clean_up_control(stcb, control);
oper = 
sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
@@ -870,7 +870,7 @@ sctp_inject_old_data_unordered(struct sc
if (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) {
/* Its the very first one. */
SCTPDBG(SCTP_DEBUG_XXX,
-   "chunk is a first fsn:%d becomes fsn_included\n",
+   "chunk is a first fsn: %u becomes fsn_included\n",
chk->rec.data.fsn_num);
if (control->first_frag_seen) {
/*
@@ -1014,14 +1014,14 @@ sctp_deliver_reasm_check(struct sctp_tcb
return (0);
}
while (control) {
-   SCTPDBG(SCTP_DEBUG_XXX, "Looking at control:%p e(%d) ssn:%d 
top_fsn:%d inc_fsn:%d -uo\n",
+   SCTPDBG(SCTP_DEBUG_XXX, "Looking at control: %p e(%d) ssn: %u 
top_fsn: %u inc_fsn: %u -uo\n",
control, control->end_added, control->sinfo_ssn, 
control->top_fsn, control->fsn_included);
nctl = TAILQ_NEXT(control, next_instrm);
if (control->end_added) {
/* We just put the last bit on */
if (control->on_strm_q) {
if (control->on_strm_q != SCTP_ON_UNORDERED) {
-   panic("Huh control:%p on_q:%d -- not 
unordered?",
+   panic("Huh control: %p on_q: %d -- not 
unordered?",
control, control->on_strm_q);
}
TAILQ_REMOVE(>uno_inqueue, control, 
next_instrm);
@@ -1066,14 +1066,14 @@ done_un:
 */
nctl = TAILQ_NEXT(control, next_instrm);
SCTPDBG(SCTP_DEBUG_XXX,
-   "Looking at control:%p e(%d) ssn:%d top_fsn:%d inc_fsn:%d 
(lastdel:%d)- o\n",
+   "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: 
%u (lastdel: %u)- o\n",
control, control->end_added, control->sinfo_ssn,
control->top_fsn, control->fsn_included,
strm->last_sequence_delivered);
if (control->end_added) {
if (control->on_strm_q) {
if (control->on_strm_q != SCTP_ON_ORDERED) {
-   panic("Huh control:%p on_q:%d -- not 
ordered?",
+   panic("Huh control: %p on_q: %d -- not 
ordered?",
control, control->on_strm_q);
}
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
@@ -1103,7 +1103,7 @@ deliver_more:
next_to_del = strm->last_sequence_delivered + 1;
if (control) {
SCTPDBG(SCTP_DEBUG_XXX,
-   "Looking at control:%p e(%d) ssn:%d top_fsn:%d inc_fsn:%d 
(nxtdel:%d)- o\n",

svn commit: r298187 - head/sys/netinet

2016-04-18 Thread Michael Tuexen
Author: tuexen
Date: Mon Apr 18 06:38:53 2016
New Revision: 298187
URL: https://svnweb.freebsd.org/changeset/base/298187

Log:
  Don't use anonymous unions.

Modified:
  head/sys/netinet/sctp_header.h
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_header.h
==
--- head/sys/netinet/sctp_header.h  Mon Apr 18 06:32:24 2016
(r298186)
+++ head/sys/netinet/sctp_header.h  Mon Apr 18 06:38:53 2016
(r298187)
@@ -160,7 +160,7 @@ struct sctp_idata {
union {
uint32_t protocol_id;
uint32_t fsn;   /* Fragment Sequence Number */
-   };
+   } ppid_fsn;
/* user data follows */
 }  SCTP_PACKED;
 

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Mon Apr 18 06:32:24 2016
(r298186)
+++ head/sys/netinet/sctp_indata.c  Mon Apr 18 06:38:53 2016
(r298187)
@@ -1558,7 +1558,7 @@ sctp_process_a_data_chunk(struct sctp_tc
if (ch->ch.chunk_flags & SCTP_DATA_FIRST_FRAG)
fsn = 0;
else
-   fsn = ntohl(nch->dp.fsn);
+   fsn = ntohl(nch->dp.ppid_fsn.fsn);
old_data = 0;
} else {
ch = (struct sctp_data_chunk *)sctp_m_getptr(*m, offset,

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Mon Apr 18 06:32:24 2016
(r298186)
+++ head/sys/netinet/sctp_output.c  Mon Apr 18 06:38:53 2016
(r298187)
@@ -7641,9 +7641,9 @@ dont_do_it:
ndchkh->dp.reserved = htons(0);
ndchkh->dp.msg_id = htonl(sp->msg_id);
if (sp->fsn == 0)
-   ndchkh->dp.protocol_id = chk->rec.data.payloadtype;
+   ndchkh->dp.ppid_fsn.protocol_id = 
chk->rec.data.payloadtype;
else
-   ndchkh->dp.fsn = htonl(sp->fsn);
+   ndchkh->dp.ppid_fsn.fsn = htonl(sp->fsn);
sp->fsn++;
ndchkh->ch.chunk_length = htons(chk->send_size);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r298131 - head/sys/conf

2016-04-18 Thread hiren panchasara
On 04/17/16 at 12:20P, Alexander Leidinger wrote:
> 
> Quoting Luiz Otavio O Souza  (from Sat, 16 Apr 2016  
> 20:54:55 + (UTC)):
> 
> > Author: loos
> > Date: Sat Apr 16 20:54:55 2016
> > New Revision: 298131
> > URL: https://svnweb.freebsd.org/changeset/base/298131
> >
> > Log:
> >   Add Codel to NOTES.
> 
> I haven't found much documentation about this. It looks like it is  
> only available in PF, but not in dummynet. Is this correct? Are there  
> somewhere examples for the use of codel (options/parameters/HOWTO)? I  
> would expect in places where e.g. "red" could be used, but I don't  
> find any mention of codel in e.g. the FreeBSD handbook.

I'd also appreciate if more details on 1) how to use it 2) under what
scenarios/workloads would this be most beneficial. And more importantly
3) how was this addition validated.

Thank you for the work!

Cheers,
Hiren


pgp2Y6KW8lk8G.pgp
Description: PGP signature


svn commit: r298185 - head/sys/mips/mediatek

2016-04-18 Thread Stanislav Galabov
Author: sgalabov
Date: Mon Apr 18 06:15:58 2016
New Revision: 298185
URL: https://svnweb.freebsd.org/changeset/base/298185

Log:
  Allow RT3350 CPU clock to be detected as part of RT3050/RT3052 detection
  
  OpenWRT's dts files treat RT3050/RT3052/RT3350 within the same SoC dtsi
  file, so we need to distinguish between the three dynamically, mainly
  because the bit we use to determine the clock speed on RT3050/RT3052
  can actually be floating on RT3350 and RT3350 is always at 320MHz.
  
  Approved by:  adrian (mentor)
  Sponsored by: Smartcom - Bulgaria AD
  Differential Revision:https://reviews.freebsd.org/D5983

Modified:
  head/sys/mips/mediatek/mtk_soc.c
  head/sys/mips/mediatek/mtk_sysctl.h

Modified: head/sys/mips/mediatek/mtk_soc.c
==
--- head/sys/mips/mediatek/mtk_soc.cMon Apr 18 06:12:00 2016
(r298184)
+++ head/sys/mips/mediatek/mtk_soc.cMon Apr 18 06:15:58 2016
(r298185)
@@ -76,13 +76,17 @@ static const struct ofw_compat_data comp
 static uint32_t
 mtk_detect_cpuclk_rt305x(bus_space_tag_t bst, bus_space_handle_t bsh)
 {
-   uint32_t clk;
+   uint32_t val;
+
+   val = bus_space_read_4(bst, bsh, SYSCTL_CHIPID0_3);
+   if (val == RT3350_CHIPID0_3)
+   return (MTK_CPU_CLK_320MHZ);
 
-   clk = bus_space_read_4(bst, bsh, SYSCTL_SYSCFG);
-   clk >>= RT305X_CPU_CLKSEL_OFF;
-   clk &= RT305X_CPU_CLKSEL_MSK;
+   val = bus_space_read_4(bst, bsh, SYSCTL_SYSCFG);
+   val >>= RT305X_CPU_CLKSEL_OFF;
+   val &= RT305X_CPU_CLKSEL_MSK;
 
-   return ((clk == 0) ? MTK_CPU_CLK_320MHZ : MTK_CPU_CLK_384MHZ);
+   return ((val == 0) ? MTK_CPU_CLK_320MHZ : MTK_CPU_CLK_384MHZ);
 }
 
 static uint32_t
@@ -265,10 +269,8 @@ mtk_soc_try_early_detect(void)
switch (mtk_soc_socid) {
case MTK_SOC_RT3050:  /* fallthrough */
case MTK_SOC_RT3052:
-   mtk_soc_cpuclk = mtk_detect_cpuclk_rt305x(bst, bsh);
-   break;
case MTK_SOC_RT3350:
-   mtk_soc_cpuclk = MTK_CPU_CLK_320MHZ;
+   mtk_soc_cpuclk = mtk_detect_cpuclk_rt305x(bst, bsh);
break;
case MTK_SOC_RT3352:
mtk_soc_cpuclk = mtk_detect_cpuclk_rt3352(bst, bsh);

Modified: head/sys/mips/mediatek/mtk_sysctl.h
==
--- head/sys/mips/mediatek/mtk_sysctl.h Mon Apr 18 06:12:00 2016
(r298184)
+++ head/sys/mips/mediatek/mtk_sysctl.h Mon Apr 18 06:15:58 2016
(r298185)
@@ -52,6 +52,8 @@
 
 #define SYSCFG1_USB_HOST_MODE  (1<<10)
 
+#define RT3350_CHIPID0_3   0x5452
+
 extern uint32_tmtk_sysctl_get(uint32_t);
 extern voidmtk_sysctl_set(uint32_t, uint32_t);
 extern voidmtk_sysctl_clr_set(uint32_t, uint32_t, uint32_t);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298184 - head/usr.bin/whereis

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 06:12:00 2016
New Revision: 298184
URL: https://svnweb.freebsd.org/changeset/base/298184

Log:
  Use NULL instead of 0 for pointers.
  
  realloc will return NULL if it cannot allocate memory.
  
  MFC after:2 weeks.

Modified:
  head/usr.bin/whereis/whereis.c

Modified: head/usr.bin/whereis/whereis.c
==
--- head/usr.bin/whereis/whereis.c  Mon Apr 18 06:02:26 2016
(r298183)
+++ head/usr.bin/whereis/whereis.c  Mon Apr 18 06:12:00 2016
(r298184)
@@ -461,7 +461,7 @@ main(int argc, char **argv)
nlen = strlen(cp);
bin = realloc(bin, 
  olen + nlen + 2);
-   if (bin == 0)
+   if (bin == NULL)
abort();
strcat(bin, " ");
strcat(bin, cp);
@@ -535,7 +535,7 @@ main(int argc, char **argv)
nlen = strlen(cp2);
man = realloc(man, 
  olen + nlen + 2);
-   if (man == 0)
+   if (man == NULL)
abort();
strcat(man, " ");
strcat(man, cp2);
@@ -574,7 +574,7 @@ main(int argc, char **argv)
nlen = strlen(cp);
src = realloc(src, 
  olen + nlen + 2);
-   if (src == 0)
+   if (src == NULL)
abort();
strcat(src, " ");
strcat(src, cp);
@@ -643,7 +643,7 @@ main(int argc, char **argv)
src = realloc(src, 
  olen + 
  nlen + 2);
-   if (src == 0)
+   if (src == NULL)
abort();
strcat(src, " ");
strcat(src, buf);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298183 - head/usr.bin/rpcgen

2016-04-18 Thread Marcelo Araujo
Author: araujo
Date: Mon Apr 18 06:02:26 2016
New Revision: 298183
URL: https://svnweb.freebsd.org/changeset/base/298183

Log:
  Use NULL for pointers.
  
  strrchr(3) will return NULL if the character does not appears in
  the string.
  
  MFC after:2 weeks.

Modified:
  head/usr.bin/rpcgen/rpc_main.c

Modified: head/usr.bin/rpcgen/rpc_main.c
==
--- head/usr.bin/rpcgen/rpc_main.c  Mon Apr 18 05:46:18 2016
(r298182)
+++ head/usr.bin/rpcgen/rpc_main.c  Mon Apr 18 06:02:26 2016
(r298183)
@@ -451,7 +451,7 @@ generate_guard(const char *pathname)
char *guard, *tmp, *stopat;
 
filename = strrchr(pathname, '/');  /* find last component */
-   filename = ((filename == 0) ? pathname : filename+1);
+   filename = ((filename == NULL) ? pathname : filename+1);
guard = xstrdup(filename);
stopat = strrchr(guard, '.');
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"