summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-03-13 10:27:25 -0300
committerRenato Botelho <renato@netgate.com>2017-03-13 10:27:25 -0300
commitf391165890a47339ab36ad68ac2e8a7ac318a2f4 (patch)
treebb32a2782e69e28e5b16c4baa2891da7f2193c37 /usr.sbin
parent01a697b38d55406857d04f6b92d9aaf15e492384 (diff)
parentf5b4bf3db9bb31ce466c39af8ee4b81aa991c7a6 (diff)
downloadFreeBSD-src-f391165890a47339ab36ad68ac2e8a7ac318a2f4.zip
FreeBSD-src-f391165890a47339ab36ad68ac2e8a7ac318a2f4.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/camdd/camdd.c37
-rw-r--r--usr.sbin/ntp/doc/ntp.conf.54
-rw-r--r--usr.sbin/ntp/doc/ntp.keys.54
-rw-r--r--usr.sbin/route6d/route6d.c2
-rw-r--r--usr.sbin/syslogd/Makefile4
-rw-r--r--usr.sbin/syslogd/syslogd.c10
6 files changed, 25 insertions, 36 deletions
diff --git a/usr.sbin/camdd/camdd.c b/usr.sbin/camdd/camdd.c
index 1bcd091..05225f6 100644
--- a/usr.sbin/camdd/camdd.c
+++ b/usr.sbin/camdd/camdd.c
@@ -420,9 +420,9 @@ struct camdd_dev {
};
static sem_t camdd_sem;
-static int need_exit = 0;
-static int error_exit = 0;
-static int need_status = 0;
+static sig_atomic_t need_exit = 0;
+static sig_atomic_t error_exit = 0;
+static sig_atomic_t need_status = 0;
#ifndef min
#define min(a, b) (a < b) ? a : b
@@ -712,11 +712,7 @@ camdd_alloc_buf(struct camdd_dev *dev, camdd_buf_type buf_type)
return (buf);
bailout_error:
- if (data_ptr != NULL)
- free(data_ptr);
-
- if (buf != NULL)
- free(buf);
+ free(data_ptr);
return (NULL);
}
@@ -2262,6 +2258,7 @@ camdd_file_run(struct camdd_dev *dev)
if (file_dev->tmp_buf == NULL) {
buf->status = CAMDD_STATUS_ERROR;
error_count++;
+ pthread_mutex_lock(&dev->mutex);
goto bailout;
}
for (i = 0, cur_offset = 0; i < data->sg_count; i++) {
@@ -2984,7 +2981,6 @@ int
camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io,
int retry_count, int timeout)
{
- char *device = NULL;
struct cam_device *new_cam_dev = NULL;
struct camdd_dev *devs[2];
struct timespec start_time;
@@ -3004,12 +3000,11 @@ camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io,
for (i = 0; i < num_io_opts; i++) {
switch (io_opts[i].dev_type) {
case CAMDD_DEV_PASS: {
- camdd_argmask new_arglist = CAMDD_ARG_NONE;
- int bus = 0, target = 0, lun = 0;
- char name[30];
- int rv;
-
if (isdigit(io_opts[i].dev_name[0])) {
+ camdd_argmask new_arglist = CAMDD_ARG_NONE;
+ int bus = 0, target = 0, lun = 0;
+ int rv;
+
/* device specified as bus:target[:lun] */
rv = parse_btl(io_opts[i].dev_name, &bus,
&target, &lun, &new_arglist);
@@ -3025,23 +3020,21 @@ camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io,
lun = 0;
new_arglist |= CAMDD_ARG_LUN;
}
+ new_cam_dev = cam_open_btl(bus, target, lun,
+ O_RDWR, NULL);
} else {
+ char name[30];
+
if (cam_get_device(io_opts[i].dev_name, name,
sizeof name, &unit) == -1) {
warnx("%s", cam_errbuf);
error = 1;
goto bailout;
}
- device = strdup(name);
- new_arglist |= CAMDD_ARG_DEVICE |CAMDD_ARG_UNIT;
+ new_cam_dev = cam_open_spec_device(name, unit,
+ O_RDWR, NULL);
}
- if (new_arglist & (CAMDD_ARG_BUS | CAMDD_ARG_TARGET))
- new_cam_dev = cam_open_btl(bus, target, lun,
- O_RDWR, NULL);
- else
- new_cam_dev = cam_open_spec_device(device, unit,
- O_RDWR, NULL);
if (new_cam_dev == NULL) {
warnx("%s", cam_errbuf);
error = 1;
diff --git a/usr.sbin/ntp/doc/ntp.conf.5 b/usr.sbin/ntp/doc/ntp.conf.5
index 22c0cd3..5a86a39 100644
--- a/usr.sbin/ntp/doc/ntp.conf.5
+++ b/usr.sbin/ntp/doc/ntp.conf.5
@@ -13,10 +13,6 @@
.Nd Network Time Protocol (NTP) daemon configuration file format
.Sh SYNOPSIS
.Nm
-.Op Fl \-option\-name
-.Op Fl \-option\-name Ar value
-.Pp
-All arguments must be options.
.Pp
.Sh DESCRIPTION
The
diff --git a/usr.sbin/ntp/doc/ntp.keys.5 b/usr.sbin/ntp/doc/ntp.keys.5
index 4dba058..7c4e50a 100644
--- a/usr.sbin/ntp/doc/ntp.keys.5
+++ b/usr.sbin/ntp/doc/ntp.keys.5
@@ -11,10 +11,6 @@
.Sh NAME
.Nm ntp.keys
.Nd NTP symmetric key file format
-
-.Sh NAME
-.Nm ntp.keys
-.Nd NTP symmetric key file format
.Sh SYNOPSIS
.Nm
.Op Fl \-option\-name
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c
index 90a492f..41f8fe3 100644
--- a/usr.sbin/route6d/route6d.c
+++ b/usr.sbin/route6d/route6d.c
@@ -1062,6 +1062,7 @@ sendpacket(struct sockaddr_in6 *sin6, int len)
iov[0].iov_len = len;
m.msg_iov = iov;
m.msg_iovlen = 1;
+ m.msg_flags = 0;
if (!idx) {
m.msg_control = NULL;
m.msg_controllen = 0;
@@ -1126,6 +1127,7 @@ riprecv(void)
cm = (struct cmsghdr *)cmsgbuf;
m.msg_control = (caddr_t)cm;
m.msg_controllen = sizeof(cmsgbuf);
+ m.msg_flags = 0;
if ((len = recvmsg(ripsock, &m, 0)) < 0) {
fatal("recvmsg");
/*NOTREACHED*/
diff --git a/usr.sbin/syslogd/Makefile b/usr.sbin/syslogd/Makefile
index 716efbe..d116e3c 100644
--- a/usr.sbin/syslogd/Makefile
+++ b/usr.sbin/syslogd/Makefile
@@ -3,7 +3,7 @@
.include <src.opts.mk>
-.PATH: ${.CURDIR}/../../usr.bin/wall
+.PATH: ${SRCTOP}/usr.bin/wall
PROG= syslogd
MAN= syslog.conf.5 syslogd.8
@@ -17,6 +17,6 @@ WARNS?= 3
CFLAGS+= -DINET6
.endif
-CFLAGS+= -I${.CURDIR}/../../usr.bin/wall
+CFLAGS+= -I${SRCTOP}/usr.bin/wall
.include <bsd.prog.mk>
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 7603be8..7104096 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$");
* Priority comparison code by Harlan Stenn.
*/
+/* Maximum number of characters in time of last occurrence */
+#define MAXDATELEN 16
#define MAXLINE 1024 /* maximum line length */
#define MAXSVLINE MAXLINE /* maximum saved line length */
#define DEFUPRI (LOG_USER|LOG_NOTICE)
@@ -205,7 +207,7 @@ struct filed {
} f_ring;
} f_un;
char f_prevline[MAXSVLINE]; /* last message logged */
- char f_lasttime[16]; /* time of last occurrence */
+ char f_lasttime[MAXDATELEN]; /* time of last occurrence */
char f_prevhost[MAXHOSTNAMELEN]; /* host from which recd. */
int f_prevpri; /* pri of f_prevline */
int f_prevlen; /* length of f_prevline */
@@ -986,7 +988,7 @@ logmsg(int pri, const char *msg, const char *from, int flags)
* Check to see if msg looks non-standard.
*/
msglen = strlen(msg);
- if (msglen < 16 || msg[3] != ' ' || msg[6] != ' ' ||
+ if (msglen < MAXDATELEN || msg[3] != ' ' || msg[6] != ' ' ||
msg[9] != ':' || msg[12] != ':' || msg[15] != ' ')
flags |= ADDDATE;
@@ -995,8 +997,8 @@ logmsg(int pri, const char *msg, const char *from, int flags)
timestamp = ctime(&now) + 4;
} else {
timestamp = msg;
- msg += 16;
- msglen -= 16;
+ msg += MAXDATELEN;
+ msglen -= MAXDATELEN;
}
/* skip leading blanks */
OpenPOWER on IntegriCloud