diff options
Diffstat (limited to 'usr/src/cmd')
-rw-r--r-- | usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d | 46 | ||||
-rw-r--r-- | usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d.out | 3 | ||||
-rw-r--r-- | usr/src/cmd/gss/gssd/gssd_clnt_stubs.c | 11 | ||||
-rw-r--r-- | usr/src/cmd/more/more.c | 8 | ||||
-rw-r--r-- | usr/src/cmd/zdb/zdb.c | 21 |
5 files changed, 71 insertions, 18 deletions
diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d new file mode 100644 index 0000000000..50c14d3ced --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d @@ -0,0 +1,46 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2017 Panzura. All rights reserved. + */ + +/* + * ASSERTION: + * Positive test for normalization() of stddev() + * + * SECTION: Aggregations/Normalization + * + */ + +#pragma D option quiet +#pragma D option aggrate=1ms +#pragma D option switchrate=50ms + +BEGIN +{ + i = 0; +} + +tick-100ms +/i < 11/ +{ + @ = stddev(i * 100); + i++; +} + +tick-100ms +/i == 11/ +{ + printf("normalized data:\n"); + normalize(@, 10); + exit(0); +} diff --git a/usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d.out b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d.out new file mode 100644 index 0000000000..a629b1fdb5 --- /dev/null +++ b/usr/src/cmd/dtrace/test/tst/common/aggs/tst.stddev.normalize.d.out @@ -0,0 +1,3 @@ +normalized data: + + 31 diff --git a/usr/src/cmd/gss/gssd/gssd_clnt_stubs.c b/usr/src/cmd/gss/gssd/gssd_clnt_stubs.c index 8be41c666d..9eba27a66c 100644 --- a/usr/src/cmd/gss/gssd/gssd_clnt_stubs.c +++ b/usr/src/cmd/gss/gssd/gssd_clnt_stubs.c @@ -1064,12 +1064,11 @@ kgss_accept_sec_context( } else gssd_ver_cred_handle = GSSD_NO_CREDENTIAL; - err = kgss_accept_sec_context_wrapped(minor_status, - &kctx->gssd_ctx, - &kctx->gssd_ctx_verifier, gssd_ver_cred_handle, - gssd_cred_verifier, input_token, input_chan_bindings, - src_name, mech_type, output_token, ret_flags, - time_rec, delegated_cred_handle, uid); + err = kgss_accept_sec_context_wrapped(minor_status, &kctx->gssd_ctx, + &kctx->gssd_ctx_verifier, gssd_ver_cred_handle, + gssd_cred_verifier, input_token, input_chan_bindings, + src_name, mech_type, output_token, ret_flags, + time_rec, delegated_cred_handle, uid); if (GSS_ERROR(err)) { KGSS_FREE(kctx); diff --git a/usr/src/cmd/more/more.c b/usr/src/cmd/more/more.c index 523d87e7cd..9bbe46daad 100644 --- a/usr/src/cmd/more/more.c +++ b/usr/src/cmd/more/more.c @@ -1089,8 +1089,8 @@ command(char *filename, register FILE *f) done++; goto endsw; } - Currline++; - nlines--; + Currline++; + nlines--; } ret (dlines); case '\n': @@ -1470,8 +1470,8 @@ skiplns(register off_t n, register FILE *f) while ((c = Getc (f)) != '\n') if (c == EOF) return; - n--; - Currline++; + n--; + Currline++; } } diff --git a/usr/src/cmd/zdb/zdb.c b/usr/src/cmd/zdb/zdb.c index 0137e6f448..75f1d6a815 100644 --- a/usr/src/cmd/zdb/zdb.c +++ b/usr/src/cmd/zdb/zdb.c @@ -2301,24 +2301,29 @@ dump_label(const char *dev) (void) snprintf(path, sizeof (path), "%s%s", ZFS_RDISK_ROOTD, dev); - if ((s = strrchr(dev, 's')) == NULL || !isdigit(*(s + 1))) + if (((s = strrchr(dev, 's')) == NULL && + (s = strchr(dev, 'p')) == NULL) || + !isdigit(*(s + 1))) (void) strlcat(path, "s0", sizeof (path)); } - if (stat64(path, &statbuf) != 0) { - (void) printf("failed to stat '%s': %s\n", path, + if ((fd = open64(path, O_RDONLY)) < 0) { + (void) fprintf(stderr, "cannot open '%s': %s\n", path, strerror(errno)); exit(1); } - if (S_ISBLK(statbuf.st_mode)) { - (void) printf("cannot use '%s': character device required\n", - path); + if (fstat64(fd, &statbuf) != 0) { + (void) fprintf(stderr, "failed to stat '%s': %s\n", path, + strerror(errno)); + (void) close(fd); exit(1); } - if ((fd = open64(path, O_RDONLY)) < 0) { - (void) printf("cannot open '%s': %s\n", path, strerror(errno)); + if (S_ISBLK(statbuf.st_mode)) { + (void) fprintf(stderr, + "cannot use '%s': character device required\n", path); + (void) close(fd); exit(1); } |