svn commit: r283076 - in stable/10/sys: amd64/conf i386/conf

2015-05-18 Thread Jim Harris
Author: jimharris
Date: Mon May 18 19:48:41 2015
New Revision: 283076
URL: https://svnweb.freebsd.org/changeset/base/283076

Log:
  MFC r282921:
  
Add nvme and nvd drivers to GENERIC for amd64 and i386.
  
  Sponsored by: Intel

Modified:
  stable/10/sys/amd64/conf/GENERIC
  stable/10/sys/i386/conf/GENERIC
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/conf/GENERIC
==
--- stable/10/sys/amd64/conf/GENERICMon May 18 19:45:46 2015
(r283075)
+++ stable/10/sys/amd64/conf/GENERICMon May 18 19:48:41 2015
(r283076)
@@ -161,6 +161,10 @@ device mrsas   # LSI/Avago 
MegaRAID SAS
 #devicepst # Promise Supertrak SX6000
 device twe # 3ware ATA RAID
 
+# NVM Express (NVMe) support
+device nvme# base NVMe driver
+device nvd # expose NVMe namespaces as disks, 
depends on nvme
+
 # atkbdc0 controls both the keyboard and the PS/2 mouse
 device atkbdc  # AT keyboard controller
 device atkbd   # AT keyboard

Modified: stable/10/sys/i386/conf/GENERIC
==
--- stable/10/sys/i386/conf/GENERIC Mon May 18 19:45:46 2015
(r283075)
+++ stable/10/sys/i386/conf/GENERIC Mon May 18 19:48:41 2015
(r283076)
@@ -166,6 +166,10 @@ device mrsas   # LSI/Avago 
MegaRAID SAS
 device pst # Promise Supertrak SX6000
 device twe # 3ware ATA RAID
 
+# NVM Express (NVMe) support
+device nvme# base NVMe driver
+device nvd # expose NVMe namespace as disks, 
depends on nvme
+
 # atkbdc0 controls both the keyboard and the PS/2 mouse
 device atkbdc  # AT keyboard controller
 device atkbd   # AT keyboard
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to svn-src-stable-10-unsubscr...@freebsd.org


svn commit: r283083 - stable/10/usr.bin/whois

2015-05-18 Thread Xin LI
Author: delphij
Date: Mon May 18 21:27:46 2015
New Revision: 283083
URL: https://svnweb.freebsd.org/changeset/base/283083

Log:
  MFC r281959,282885 (fanf, partial),282888 (fanf):
  
  Try alternate addresses more agressively.
  
  PR: 158125
  Submitted by:   Mark Andrews marka isc org (with changes from me)
  
  whois: code cleanup
  
  Use pedantically correct types.
  
  whois: do not clobber command-line flags when tweaking O_NONBLOCK
  
  This can make whois fail to follow referrals when it should.
  The bug was introduced in r281959.

Modified:
  stable/10/usr.bin/whois/whois.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/whois/whois.c
==
--- stable/10/usr.bin/whois/whois.c Mon May 18 21:18:44 2015
(r283082)
+++ stable/10/usr.bin/whois/whois.c Mon May 18 21:27:46 2015
(r283083)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright (c) 1980, 1993
  * The Regents of the University of California.  All rights reserved.
  *
@@ -44,6 +44,7 @@ __FBSDID($FreeBSD$);
 
 #include sys/types.h
 #include sys/socket.h
+#include sys/poll.h
 #include netinet/in.h
 #include arpa/inet.h
 #include ctype.h
@@ -55,6 +56,8 @@ __FBSDID($FreeBSD$);
 #include string.h
 #include sysexits.h
 #include unistd.h
+#include fcntl.h
+#include errno.h
 
 #defineABUSEHOST   whois.abuse.net
 #defineNICHOST whois.crsnic.net
@@ -280,21 +283,137 @@ whois(const char *query, const char *hos
FILE *sfi, *sfo;
struct addrinfo *hostres, *res;
char *buf, *host, *nhost, *p;
-   int i, s;
-   size_t c, len;
+   int s = -1, f;
+   nfds_t i, j;
+   size_t c, len, count;
+   struct pollfd *fds;
+   int timeout = 180;
 
-   s = -1;
hostres = gethostinfo(hostname, 1);
-   for (res = hostres; res; res = res-ai_next) {
-   s = socket(res-ai_family, res-ai_socktype, res-ai_protocol);
+   for (res = hostres, count = 0; res; res = res-ai_next)
+   count++;
+
+   fds = calloc(count, sizeof(*fds));
+   if (fds == NULL)
+   err(EX_OSERR, calloc());
+
+   /*
+* Traverse the result list elements and make non-block
+* connection attempts.
+*/
+   count = i = 0;
+   for (res = hostres; res != NULL; res = res-ai_next) {
+   s = socket(res-ai_family, res-ai_socktype | SOCK_NONBLOCK,
+   res-ai_protocol);
if (s  0)
continue;
-   if (connect(s, res-ai_addr, res-ai_addrlen) == 0)
-   break;
-   close(s);
+   if (connect(s, res-ai_addr, res-ai_addrlen)  0) {
+   if (errno == EINPROGRESS) {
+   /* Add the socket to poll list */
+   fds[i].fd = s;
+   fds[i].events = POLLERR | POLLHUP |
+   POLLIN | POLLOUT;
+   count++;
+   i++;
+   } else {
+   close(s);
+   s = -1;
+
+   /*
+* Poll only if we have something to poll,
+* otherwise just go ahead and try next
+* address
+*/
+   if (count == 0)
+   continue;
+   }
+   } else
+   goto done;
+
+   /*
+* If we are at the last address, poll until a connection is
+* established or we failed all connection attempts.
+*/
+   if (res-ai_next == NULL)
+   timeout = INFTIM;
+
+   /*
+* Poll the watched descriptors for successful connections:
+* if we still have more untried resolved addresses, poll only
+* once; otherwise, poll until all descriptors have errors,
+* which will be considered as ETIMEDOUT later.
+*/
+   do {
+   int n;
+
+   n = poll(fds, i, timeout);
+   if (n == 0) {
+   /*
+* No event reported in time.  Try with a
+* smaller timeout (but cap at 2-3ms)
+* after a new host have been added.
+*/
+   if (timeout = 3)
+   timeout = 1;
+
+   break;
+   } else if (n  0) {
+   /*
+ 

svn commit: r283080 - stable/10/contrib/tzdata

2015-05-18 Thread Edwin Groothuis
Author: edwin
Date: Mon May 18 21:07:44 2015
New Revision: 283080
URL: https://svnweb.freebsd.org/changeset/base/283080

Log:
  MFC of 283079,tzdata10:
  
  Update to tzdata2015d:
  
  Release 2015d - 2015-04-24 08:09:46 -0700
  
Changes affecting future time stamps
  
  Egypt will not observe DST in 2015 and will consider canceling it
  permanently.  For now, assume no DST indefinitely.
  (Thanks to Ahmed Nazmy and Tim Parenti.)
  
Change affecting past and future time zone abbreviations
  
  The abbreviations for Hawaii-Aleutian standard and daylight times
  have been changed from HAST/HADT to HST/HDT, as per US Government
  Printing Office style.  This affects only America/Adak since 1983,
  as America/Honolulu was already using the new style.

Modified:
  stable/10/contrib/tzdata/africa
  stable/10/contrib/tzdata/northamerica

Modified: stable/10/contrib/tzdata/africa
==
--- stable/10/contrib/tzdata/africa Mon May 18 21:05:11 2015
(r283079)
+++ stable/10/contrib/tzdata/africa Mon May 18 21:07:44 2015
(r283080)
@@ -328,35 +328,20 @@ Rule  Egypt   2007only-   Sep Thu=1  
24:00   
 # http://almogaz.com/news/weird-news/2015/04/05/1947105 ...
 # http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
 
-# From Paul Eggert (2015-04-08):
-# For now, guess that later spring and fall transitions will use
-# 2014's rules, and guess that Egypt will switch to standard time at
-# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
-# first Friday after Ramadan.  To implement this,
-# transition dates for 2015 through 2037 were determined by running
-# the following program under GNU Emacs 24.4, with the results integrated
-# by hand into the table below.  Ramadan again intrudes on the guessed
-# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
-# (let ((islamic-year 1436))
-#   (while ( islamic-year 1460)
-# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-#   (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-#   (friday 5))
-#   (while (/= friday (mod a 7))
-# (setq a (1- a)))
-#   (while (/= friday (mod b 7))
-# (setq b (1+ b)))
-#   (setq a (1- a))
-#   (setq b (1- b))
-#   (setq a (calendar-gregorian-from-absolute a))
-#   (setq b (calendar-gregorian-from-absolute b))
-#   (insert
-#(format
-# (concat Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n
-# Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n)
-# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)
-# (setq islamic-year (+ 1 islamic-year
+# From Ahmed Nazmy (2015-04-20):
+# Egypt's ministers cabinet just announced ... that it will cancel DST at
+# least for 2015.
+#
+# From Tim Parenti (2015-04-20):
+# 
http://english.ahram.org.eg/WriterArticles/NewsContentP/1/128195/Egypt/No-daylight-saving-this-summer-Egypts-prime-minist.aspx
+# Egypt's cabinet agreed on Monday not to switch clocks for daylight saving
+# time this summer, and carry out studies on the possibility of canceling the
+# practice altogether in future years.
+#
+# From Paul Eggert (2015-04-20):
+# For now, assume DST will be canceled.  Any resumption would likely
+# use different rules anyway.
+
 Rule   Egypt   2008only-   Aug lastThu 24:00   0   -
 Rule   Egypt   2009only-   Aug 20  24:00   0   -
 Rule   Egypt   2010only-   Aug 10  24:00   0   -
@@ -365,22 +350,7 @@ Rule   Egypt   2010only-   Sep lastThu 
24:00
 Rule   Egypt   2014only-   May 15  24:00   1:00S
 Rule   Egypt   2014only-   Jun 26  24:00   0   -
 Rule   Egypt   2014only-   Jul 31  24:00   1:00S
-Rule   Egypt   2014max -   Sep lastThu 24:00   0   -
-Rule   Egypt   20152019-   Apr lastThu 24:00   1:00S
-Rule   Egypt   2015only-   Jun 11  24:00   0   -
-Rule   Egypt   2015only-   Jul 23  24:00   1:00S
-Rule   Egypt   2016only-   Jun  2  24:00   0   -
-Rule   Egypt   2016only-   Jul  7  24:00   1:00S
-Rule   Egypt   2017only-   May 25  24:00   0   -
-Rule   Egypt   2017only-   Jun 29  24:00   1:00S
-Rule   Egypt   2018only-   May 10  24:00   0   -
-Rule   Egypt   2018only-   Jun 14  24:00   1:00S
-Rule   Egypt   2019only-   May  2  24:00   0   -
-Rule   Egypt   2019only-   Jun  6  24:00   1:00S
-Rule   Egypt   2020only-   May 28  24:00   1:00S

svn commit: r283054 - stable/10/lib/libmd

2015-05-18 Thread Garrett Cooper
Author: ngie
Date: Mon May 18 10:45:18 2015
New Revision: 283054
URL: https://svnweb.freebsd.org/changeset/base/283054

Log:
  MFC r281928:
  
  Avoid an infinite loop by ensuring that the amount of bytes read is greater
  than 0 in MDXFileChunk when calculating the checksum
  
  This edgecase can be triggered if the file is truncated while the checksum
  is being calculated (i.e. the EOF is reached)
  
  Differential Revision: https://reviews.freebsd.org/D2351 (patch by darius)
  PR: 196694
  Reviewed by: delphij, ngie
  Submitted by: Daniel O'Connor dar...@dons.net.au
  Sponsored by: EMC / Isilon Storage Division

Modified:
  stable/10/lib/libmd/mdXhl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libmd/mdXhl.c
==
--- stable/10/lib/libmd/mdXhl.c Mon May 18 10:31:23 2015(r283053)
+++ stable/10/lib/libmd/mdXhl.c Mon May 18 10:45:18 2015(r283054)
@@ -74,7 +74,7 @@ MDXFileChunk(const char *filename, char 
i = read(f, buffer, sizeof(buffer));
else
i = read(f, buffer, n);
-   if (i  0) 
+   if (i = 0) 
break;
MDXUpdate(ctx, buffer, i);
n -= i;
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to svn-src-stable-10-unsubscr...@freebsd.org