summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-08-12 14:55:22 -0700
committerRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-08-12 14:55:22 -0700
commit23a1ccea6aac035f084a7a4cdc968687d1b02daf (patch)
tree6ed5e310ce6dd96f997b0c0f9735805d513d898a /usr/src/cmd
parent29c3196fe2acc65721d8b9b5ea708d3a87facde0 (diff)
downloadillumos-joyent-23a1ccea6aac035f084a7a4cdc968687d1b02daf.tar.gz
PSARC 2010/299 GNU/Linux/BSD compatibility functions
6960818 add get_nprocs(), getline(), strdupa(), strndup() to libc 6901783 strndup would be nice 6824404 libc should provide ffsl() & ffsll() 6793969 RFE: Add|stpcpy|to libc 6735446 Want a __progname symbol for BSD-style source compatibility 6421095 Solaris should provide strcasestr 6275498 Provide string compare functions wcscasecmp,wcsncasecmp in solaris like linux --HG-- rename : usr/src/lib/libc/port/gen/strcasecmp.c => usr/src/lib/libc/port/gen/ascii_strcasecmp.c rename : usr/src/lib/libc/port/gen/strncasecmp.c => usr/src/lib/libc/port/gen/ascii_strncasecmp.c rename : usr/src/lib/libc/sparc/gen/strcasecmp.s => usr/src/lib/libc/sparc/gen/ascii_strcasecmp.s rename : usr/src/lib/libc/sparcv9/gen/strcasecmp.s => usr/src/lib/libc/sparcv9/gen/ascii_strcasecmp.s
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/acctadm/main.c6
-rw-r--r--usr/src/cmd/acctadm/utils.c6
-rw-r--r--usr/src/cmd/acctadm/utils.h6
-rw-r--r--usr/src/cmd/awk/awk.h5
-rw-r--r--usr/src/cmd/awk/maketab.c5
-rw-r--r--usr/src/cmd/awk/run.c5
-rw-r--r--usr/src/cmd/bnu/sysfiles.c24
-rw-r--r--usr/src/cmd/boot/bootadm/bootadm_hyper.c35
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile6
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/proto.h5
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strcasestr.c49
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strsep.c67
-rw-r--r--usr/src/cmd/cpc/common/strtoset.c7
-rw-r--r--usr/src/cmd/csplit/csplit.c45
-rw-r--r--usr/src/cmd/devctl/devctl.c30
-rw-r--r--usr/src/cmd/diff3/diff3prog.c31
-rw-r--r--usr/src/cmd/dis/dis_target.c8
-rw-r--r--usr/src/cmd/ed/ed.c30
-rw-r--r--usr/src/cmd/eeprom/common/error.c11
-rw-r--r--usr/src/cmd/eeprom/i386/benv.c5
-rw-r--r--usr/src/cmd/eeprom/sparc/openprom.c10
-rw-r--r--usr/src/cmd/env/env.c19
-rw-r--r--usr/src/cmd/eqn/io.c13
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_idspace.c54
-rw-r--r--usr/src/cmd/fm/fmd/common/fmd_module.c3
-rw-r--r--usr/src/cmd/fm/modules/common/ip-transport/ip.c4
-rw-r--r--usr/src/cmd/format/label.c18
-rw-r--r--usr/src/cmd/format/modify_partition.c9
-rw-r--r--usr/src/cmd/format/partition.c8
-rw-r--r--usr/src/cmd/fps/Makefile28
-rw-r--r--usr/src/cmd/fs.d/nfs/lib/nfslog_config.c19
-rw-r--r--usr/src/cmd/fs.d/udfs/fsck/utilities.c27
-rw-r--r--usr/src/cmd/fs.d/ufs/fsck/utilities.c9
-rw-r--r--usr/src/cmd/fs.d/ufs/mkfs/mkfs.c10
-rw-r--r--usr/src/cmd/idmap/idmap/idmap.c19
-rw-r--r--usr/src/cmd/ipf/lib/common/getline.c9
-rw-r--r--usr/src/cmd/ldap/common/ldaptest.c135
-rw-r--r--usr/src/cmd/mail/copymt.c14
-rw-r--r--usr/src/cmd/mail/gethead.c29
-rw-r--r--usr/src/cmd/mail/mail.h13
-rw-r--r--usr/src/cmd/mail/sendmail.c15
-rw-r--r--usr/src/cmd/mailx/collect.c16
-rw-r--r--usr/src/cmd/mailx/hdr/def.h7
-rw-r--r--usr/src/cmd/mailx/send.c12
-rw-r--r--usr/src/cmd/mdb/common/modules/libc/libc.c7
-rw-r--r--usr/src/cmd/more/more.c12
-rw-r--r--usr/src/cmd/ndmpd/ndmp/ndmpd_dtime.c6
-rw-r--r--usr/src/cmd/nscd/nscd_initf.c6
-rw-r--r--usr/src/cmd/oawk/makeprctab.c5
-rw-r--r--usr/src/cmd/oawk/run.c5
-rw-r--r--usr/src/cmd/pg/pg.c17
-rw-r--r--usr/src/cmd/picl/plugins/sun4u/blade/bsc/picllom.c40
-rw-r--r--usr/src/cmd/prctl/prctl.c7
-rw-r--r--usr/src/cmd/prctl/utils.c8
-rw-r--r--usr/src/cmd/prctl/utils.h8
-rw-r--r--usr/src/cmd/prtconf/prtconf.c6
-rw-r--r--usr/src/cmd/prtdiag/main.c14
-rw-r--r--usr/src/cmd/rcap/common/utils.c8
-rw-r--r--usr/src/cmd/rcap/common/utils.h8
-rw-r--r--usr/src/cmd/rcap/rcapadm/rcapadm.c10
-rw-r--r--usr/src/cmd/rcap/rcapd/rcapd_main.c10
-rw-r--r--usr/src/cmd/rcap/rcapstat/rcapstat.c6
-rw-r--r--usr/src/cmd/rctladm/rctladm.c8
-rw-r--r--usr/src/cmd/rctladm/utils.c8
-rw-r--r--usr/src/cmd/rctladm/utils.h8
-rw-r--r--usr/src/cmd/sendmail/db/clib/strsep.c12
-rw-r--r--usr/src/cmd/sgs/crle/common/print.c31
-rw-r--r--usr/src/cmd/sgs/libconv/common/demangle.c7
-rw-r--r--usr/src/cmd/sgs/lorder/lorder.sh16
-rw-r--r--usr/src/cmd/sgs/rtld/common/external.c20
-rw-r--r--usr/src/cmd/ssh/include/config.h6
-rw-r--r--usr/src/cmd/svr4pkg/libinst/dockdeps.c13
-rw-r--r--usr/src/cmd/vi/misc/ctags.c16
-rw-r--r--usr/src/cmd/vi/port/ex.h9
-rw-r--r--usr/src/cmd/vi/port/ex_cmds.c8
-rw-r--r--usr/src/cmd/vi/port/ex_cmdsub.c25
-rw-r--r--usr/src/cmd/vi/port/ex_get.c13
-rw-r--r--usr/src/cmd/vi/port/ex_io.c15
-rw-r--r--usr/src/cmd/vi/port/ex_re.c13
-rw-r--r--usr/src/cmd/vi/port/ex_set.c15
-rw-r--r--usr/src/cmd/vi/port/ex_subr.c13
-rw-r--r--usr/src/cmd/vi/port/ex_temp.c15
-rw-r--r--usr/src/cmd/vi/port/ex_vadj.c19
-rw-r--r--usr/src/cmd/vi/port/ex_vget.c13
-rw-r--r--usr/src/cmd/vi/port/ex_voper.c6
-rw-r--r--usr/src/cmd/vi/port/ex_vops.c10
-rw-r--r--usr/src/cmd/vi/port/ex_vops2.c12
-rw-r--r--usr/src/cmd/vi/port/ex_vops3.c21
-rw-r--r--usr/src/cmd/vi/port/ex_vwind.c23
-rw-r--r--usr/src/cmd/vi/port/exrecover.c10
-rw-r--r--usr/src/cmd/ypcmd/mknetid/getname.c16
-rw-r--r--usr/src/cmd/ypcmd/mknetid/mknetid.c22
-rw-r--r--usr/src/cmd/ypcmd/revnetgroup/revnetgroup.c16
-rw-r--r--usr/src/cmd/ypcmd/revnetgroup/util.c13
-rw-r--r--usr/src/cmd/ypcmd/revnetgroup/util.h14
95 files changed, 583 insertions, 952 deletions
diff --git a/usr/src/cmd/acctadm/main.c b/usr/src/cmd/acctadm/main.c
index 8176214b9e..83cb63b314 100644
--- a/usr/src/cmd/acctadm/main.c
+++ b/usr/src/cmd/acctadm/main.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/acctctl.h>
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- (void) setprogname(argv[0]);
+ (void) setpname(argv[0]);
for (; optind < argc; optind++) {
while ((c = getopt(argc, argv, OPTS)) != (int)EOF) {
diff --git a/usr/src/cmd/acctadm/utils.c b/usr/src/cmd/acctadm/utils.c
index 53afbce282..289111e210 100644
--- a/usr/src/cmd/acctadm/utils.c
+++ b/usr/src/cmd/acctadm/utils.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <assert.h>
@@ -85,7 +85,7 @@ die(char *format, ...)
}
char *
-setprogname(char *arg0)
+setpname(char *arg0)
{
char *p = strrchr(arg0, '/');
diff --git a/usr/src/cmd/acctadm/utils.h b/usr/src/cmd/acctadm/utils.h
index 66a1aab6a1..e40fa53f01 100644
--- a/usr/src/cmd/acctadm/utils.h
+++ b/usr/src/cmd/acctadm/utils.h
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _UTILS_H
@@ -42,7 +42,7 @@ extern dladm_handle_t dld_handle;
extern void warn(const char *, ...);
extern void die(char *, ...);
-extern char *setprogname(char *);
+extern char *setpname(char *);
extern const char *ac_type_name(int);
extern int open_exacct_file(const char *, int);
extern boolean_t verify_exacct_file(const char *, int);
diff --git a/usr/src/cmd/awk/awk.h b/usr/src/cmd/awk/awk.h
index 9e26f2d511..987028fea2 100644
--- a/usr/src/cmd/awk/awk.h
+++ b/usr/src/cmd/awk/awk.h
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -362,6 +361,6 @@ extern Cell *bltin(Node **, int);
extern Cell *call(Node **, int);
extern Cell *arg(Node **, int);
extern Cell *getnf(Node **, int);
-extern Cell *getline(Node **, int);
+extern Cell *getaline(Node **, int);
#endif /* AWK_H */
diff --git a/usr/src/cmd/awk/maketab.c b/usr/src/cmd/awk/maketab.c
index c80e6e1c28..5c7d8601ea 100644
--- a/usr/src/cmd/awk/maketab.c
+++ b/usr/src/cmd/awk/maketab.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -101,7 +100,7 @@ struct xx {
{ CALL, "call", "call" },
{ ARG, "arg", "arg" },
{ VARNF, "getnf", "NF" },
- { GETLINE, "getline", "getline" },
+ { GETLINE, "getaline", "getline" },
{ 0, "", "" },
};
diff --git a/usr/src/cmd/awk/run.c b/usr/src/cmd/awk/run.c
index 62f247ac6b..3cc8341d84 100644
--- a/usr/src/cmd/awk/run.c
+++ b/usr/src/cmd/awk/run.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -359,7 +358,7 @@ jump(Node **a, int n)
}
Cell *
-getline(Node **a, int n)
+getaline(Node **a, int n)
{
/* a[0] is variable, a[1] is operator, a[2] is filename */
register Cell *r, *x;
diff --git a/usr/src/cmd/bnu/sysfiles.c b/usr/src/cmd/bnu/sysfiles.c
index c6a472517b..db147774d0 100644
--- a/usr/src/cmd/bnu/sysfiles.c
+++ b/usr/src/cmd/bnu/sysfiles.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,17 +18,14 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "uucp.h"
#include <unistd.h>
@@ -55,7 +51,7 @@
/* private variables */
static void tokenize(), nameparse(), setfile(), setioctl(),
scansys(), scancfg(), setconfig();
-static int namematch(), nextdialers(), nextdevices(), nextsystems(), getline();
+static int namematch(), nextdialers(), nextdevices(), nextsystems(), getaline();
/* pointer arrays might be dynamically allocated */
static char *Systems[64] = {0}; /* list of Systems files */
@@ -164,7 +160,7 @@ char *service;
Systems[0] = Devices[0] = Dialers[0] = NULL;
if ((f = fopen(SYSFILES, "r")) != 0) {
- while (getline(f, buf) > 0) {
+ while (getaline(f, buf) > 0) {
/* got a (logical) line from Sysfiles */
/* strtok's of this buf continue in tokenize() */
tok = strtok(buf, " \t");
@@ -215,7 +211,7 @@ char *service, *device;
msgtime = MSGTIME;
if ((f = fopen(DEVCONFIG, "r")) != 0) {
- while (getline(f, buf) > 0) {
+ while (getaline(f, buf) > 0) {
/* got a (logical) line from Devconfig */
/* strtok's of this buf continue in tokenize() */
tok = strtok(buf, " \t");
@@ -241,7 +237,7 @@ char *service, *device;
*/
static int
-getline(f, line)
+getaline(f, line)
FILE *f;
char *line;
{ char *lptr, *lend;
@@ -484,7 +480,7 @@ char *buf;
ASSERT(len >= BUFSIZ, "BUFFER TOO SMALL", "getsysline", 0);
for(;;) {
- while (getline(fsystems, buf) != NULL)
+ while (getaline(fsystems, buf) != NULL)
if ((*buf != '#') && (*buf != ' ') &&
(*buf != '\t') && (*buf != '\n')) {
(void) _uu_resetlocale(LC_ALL, prev);
@@ -752,7 +748,7 @@ setconfig()
extern char _ProtoCfg[];
if ((f = fopen(CONFIG, "r")) != 0) {
- while (getline(f, buf) > 0) {
+ while (getaline(f, buf) > 0) {
/* got a (logical) line from Config file */
tok = strtok(buf, " \t");
if ( (tok != NULL) && (*tok != '#') ) {
diff --git a/usr/src/cmd/boot/bootadm/bootadm_hyper.c b/usr/src/cmd/boot/bootadm/bootadm_hyper.c
index eef7fe1d3d..01e7dd3e69 100644
--- a/usr/src/cmd/boot/bootadm/bootadm_hyper.c
+++ b/usr/src/cmd/boot/bootadm/bootadm_hyper.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <stdio.h>
@@ -347,9 +347,8 @@ cvt_metal_option(char *optstr)
if ((strncmp(optstr, "ttya-mode", namlen) == 0) ||
(strncmp(optstr, "ttyb-mode", namlen) == 0)) {
- char *port = alloca(namlen + 1);
+ char *port = strndupa(optstr, namlen);
- (void) strlcpy(port, optstr, namlen + 1);
return (serial_metal_to_hyper(port, value));
}
@@ -840,19 +839,15 @@ cvt_to_hyper(menu_t *mp, char *osroot, char *extra_args)
* Process important lines from menu.lst boot entry.
*/
if (lp->flags == BAM_TITLE) {
- title = alloca(strlen(lp->arg) + 1);
- (void) strcpy(title, lp->arg);
+ title = strdupa(lp->arg);
} else if (lp->cmd != NULL) {
if (strcmp(lp->cmd, "findroot") == 0) {
- findroot = alloca(strlen(lp->arg) + 1);
- (void) strcpy(findroot, lp->arg);
+ findroot = strdupa(lp->arg);
} else if (strcmp(lp->cmd, "bootfs") == 0) {
- bootfs = alloca(strlen(lp->arg) + 1);
- (void) strcpy(bootfs, lp->arg);
+ bootfs = strdupa(lp->arg);
} else if (strcmp(lp->cmd,
menu_cmds[MODULE_DOLLAR_CMD]) == 0) {
- module = alloca(strlen(lp->arg) + 1);
- (void) strcpy(module, lp->arg);
+ module = strdupa(lp->arg);
} else if ((strcmp(lp->cmd,
menu_cmds[KERNEL_DOLLAR_CMD]) == 0) &&
(ret = cvt_metal_kernel(lp->arg,
@@ -1065,25 +1060,19 @@ cvt_to_metal(menu_t *mp, char *osroot, char *menu_root)
* Process important lines from menu.lst boot entry.
*/
if (lp->flags == BAM_TITLE) {
- title = alloca(strlen(lp->arg) + 1);
- (void) strcpy(title, lp->arg);
+ title = strdupa(lp->arg);
} else if (lp->cmd != NULL) {
if (strcmp(lp->cmd, "findroot") == 0) {
- findroot = alloca(strlen(lp->arg) + 1);
- (void) strcpy(findroot, lp->arg);
+ findroot = strdupa(lp->arg);
} else if (strcmp(lp->cmd, "bootfs") == 0) {
- bootfs = alloca(strlen(lp->arg) + 1);
- (void) strcpy(bootfs, lp->arg);
+ bootfs = strdupa(lp->arg);
} else if (strcmp(lp->cmd,
menu_cmds[MODULE_DOLLAR_CMD]) == 0) {
if (strstr(lp->arg, "boot_archive") == NULL) {
- module = alloca(strlen(lp->arg) + 1);
- (void) strcpy(module, lp->arg);
+ module = strdupa(lp->arg);
cvt_hyper_module(module, &kern_path);
} else {
- barchive_path =
- alloca(strlen(lp->arg) + 1);
- (void) strcpy(barchive_path, lp->arg);
+ barchive_path = strdupa(lp->arg);
}
} else if ((strcmp(lp->cmd,
menu_cmds[KERNEL_DOLLAR_CMD]) == 0) &&
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile
index 010d42c6b9..c20b6fe882 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile
@@ -1,6 +1,5 @@
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
#
PROG= in.ftpd ftpcount ftpshut ftprestart privatepw
@@ -15,8 +14,7 @@ FTPD_OBJS= $(COMMON_OBJS) ftpd.o ftpcmd.o glob.o logwtmp.o popen.o \
access.o extensions.o realpath.o acl.o private.o \
authenticate.o conversions.o rdservers.o paths.o hostacc.o \
routevector.o restrict.o domain.o wu_fnmatch.o timeout.o \
- getpwnam.o strsep.o strcasestr.o inet.o xferlog.o gssutil.o \
- privs.o
+ getpwnam.o inet.o xferlog.o gssutil.o privs.o
FTPCOUNT_OBJS= $(COMMON_OBJS) ftpcount.o rdservers.o inet.o
FTPSHUT_OBJS= $(COMMON_OBJS) ftpshut.o rdservers.o inet.o
FTPREST_OBJS= $(COMMON_OBJS) ftprestart.o rdservers.o inet.o
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/proto.h b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/proto.h
index 5fd37d8a10..5730d2120e 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/proto.h
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/proto.h
@@ -336,8 +336,3 @@ void chown_priv_off(uid_t);
*/
char *getusershell(void);
void endusershell(void);
-
-/*
- ** support/strcasestr.c
- */
-char *strcasestr(register char *s, register char *find);
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strcasestr.c b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strcasestr.c
deleted file mode 100644
index ec80947aa7..0000000000
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strcasestr.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/****************************************************************************
-
- Copyright (c) 1999,2000 WU-FTPD Development Group.
- All rights reserved.
-
- Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994
- The Regents of the University of California.
- Portions Copyright (c) 1993, 1994 Washington University in Saint Louis.
- Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc.
- Portions Copyright (c) 1989 Massachusetts Institute of Technology.
- Portions Copyright (c) 1998 Sendmail, Inc.
- Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P. Allman.
- Portions Copyright (c) 1997 by Stan Barber.
- Portions Copyright (c) 1997 by Kent Landfield.
- Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997
- Free Software Foundation, Inc.
-
- Use and distribution of this software and its source code are governed
- by the terms and conditions of the WU-FTPD Software License ("LICENSE").
-
- If you did not receive a copy of the license, it may be obtained online
- at http://www.wu-ftpd.org/license.html.
-
- $Id: strcasestr.c,v 1.5 2000/07/01 18:36:29 wuftpd Exp $
-
-****************************************************************************/
-#include <string.h>
-/*
- * Find the first occurrence of find in s.
- */
-char *strcasestr(register char *s, register char *find)
-{
- register char c, sc;
- register size_t len;
-
- if ((c = *find++) != 0) {
- len = strlen(find);
- do {
- do {
- if ((sc = *s++) == 0)
- return (NULL);
- } while (sc != c);
- } while (strncasecmp(s, find, len) != 0);
- s--;
- }
- return ((char *) s);
-}
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strsep.c b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strsep.c
deleted file mode 100644
index 98657c4dd3..0000000000
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/strsep.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/****************************************************************************
-
- Copyright (c) 1999,2000 WU-FTPD Development Group.
- All rights reserved.
-
- Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994
- The Regents of the University of California.
- Portions Copyright (c) 1993, 1994 Washington University in Saint Louis.
- Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc.
- Portions Copyright (c) 1989 Massachusetts Institute of Technology.
- Portions Copyright (c) 1998 Sendmail, Inc.
- Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P. Allman.
- Portions Copyright (c) 1997 by Stan Barber.
- Portions Copyright (c) 1997 by Kent Landfield.
- Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997
- Free Software Foundation, Inc.
-
- Use and distribution of this software and its source code are governed
- by the terms and conditions of the WU-FTPD Software License ("LICENSE").
-
- If you did not receive a copy of the license, it may be obtained online
- at http://www.wu-ftpd.org/license.html.
-
- $Id: strsep.c,v 1.6 2000/07/01 18:36:29 wuftpd Exp $
-
-****************************************************************************/
-#include <string.h>
-#include <stdio.h>
-
-/*
- * Get next token from string *stringp, where tokens are nonempty
- * strings separated by characters from delim.
- *
- * Writes NULLs into the string at *stringp to end tokens.
- * delim need not remain constant from call to call.
- * On return, *stringp points past the last NUL written (if there might
- * be further tokens), or is NULL (if there are definitely no more tokens).
- *
- * If *stringp is NULL, strsep returns NULL.
- */
-char *strsep(register char **stringp, register const char *delim)
-{
- register char *s;
- register const char *spanp;
- register int c, sc;
- char *tok;
-
- if ((s = *stringp) == NULL)
- return (NULL);
- for (tok = s;;) {
- c = *s++;
- spanp = delim;
- do {
- if ((sc = *spanp++) == c) {
- if (c == 0)
- s = NULL;
- else
- s[-1] = 0;
- *stringp = s;
- return (tok);
- }
- } while (sc != 0);
- }
- /* NOTREACHED */
-}
diff --git a/usr/src/cmd/cpc/common/strtoset.c b/usr/src/cmd/cpc/common/strtoset.c
index 974f1555ea..dda5a227a0 100644
--- a/usr/src/cmd/cpc/common/strtoset.c
+++ b/usr/src/cmd/cpc/common/strtoset.c
@@ -18,14 +18,13 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <stdio.h>
#include <stdlib.h>
-#include <alloca.h>
#include <errno.h>
#include <libintl.h>
@@ -491,7 +490,7 @@ cpc_strtoset(cpc_t *cpcin, const char *spec, int smt)
toks[x] = NULL;
- opts = strcpy(alloca(strlen(spec) + 1), spec);
+ opts = strdupa(spec);
while (*opts != '\0') {
int idx = getsubopt(&opts, toks, &val);
diff --git a/usr/src/cmd/csplit/csplit.c b/usr/src/cmd/csplit/csplit.c
index 4f1055eda2..5506dbe139 100644
--- a/usr/src/cmd/csplit/csplit.c
+++ b/usr/src/cmd/csplit/csplit.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,16 +18,13 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
/*
* csplit - Context or line file splitter
@@ -83,7 +79,7 @@ static void fatal(char *, char *);
static offset_t findline(char *, offset_t);
static void flush(void);
static FILE *getfile(void);
-static char *getline(int);
+static char *getaline(int);
static void line_arg(char *);
static void num_arg(char *, int);
static void re_arg(char *);
@@ -143,13 +139,13 @@ main(int argc, char **argv)
if (errno == ENOSPC) {
(void) fprintf(stderr, "csplit: ");
(void) fprintf(stderr, gettext(
- "No space left on device\n"));
+ "No space left on device\n"));
exit(1);
} else {
(void) fprintf(stderr, "csplit: ");
(void) fprintf(stderr, gettext(
- "Bad write to temporary "
- "file\n"));
+ "Bad write to temporary "
+ "file\n"));
exit(1);
}
@@ -294,7 +290,7 @@ fatal(char *string, char *arg)
* Its arguments are a pointer to the compiled regular expression(expr),
* and an offset(oset). The variable lncnt is used to count the number
* of lines searched. First the current stream location is saved via
- * ftello(), and getline is called so that R.E. searching starts at the
+ * ftello(), and getaline is called so that R.E. searching starts at the
* line after the previously referenced line. The while loop checks
* that there are more lines(error if none), bumps the line count, and
* checks for the R.E. on each line. If the R.E. matches on one of the
@@ -310,11 +306,11 @@ findline(char *expr, offset_t oset)
saveloc = ftello(infile);
if (curline != (offset_t)1 || benhere) /* If first line, first time, */
- (void) getline(FALSE); /* then don't skip */
+ (void) getaline(FALSE); /* then don't skip */
else
lncnt--;
benhere = 1;
- while (getline(FALSE) != NULL) {
+ while (getaline(FALSE) != NULL) {
lncnt++;
if ((sptr = strrchr(linbuf, '\n')) != NULL)
*sptr = '\0';
@@ -362,7 +358,8 @@ getfile()
if (create) {
if (fptr == 0)
- for (fptr = file; *fptr != NULL; fptr++);
+ for (fptr = file; *fptr != NULL; fptr++)
+ continue;
(void) sprintf(fptr, "%.*d", fiwidth, ctr++);
/* check for suffix length overflow */
@@ -406,12 +403,12 @@ getfile()
/*
* Getline gets a line via fgets from the input stream "infile".
* The line is put into linbuf and may not be larger than LINSIZ.
- * If getline is called with a non-zero value, the current line
+ * If getaline is called with a non-zero value, the current line
* is bumped, otherwise it is not(for R.E. searching).
*/
static char *
-getline(int bumpcur)
+getaline(int bumpcur)
{
char *ret;
if (bumpcur)
@@ -570,15 +567,15 @@ to_line(offset_t ln)
if (curline > ln)
fatal("%s - out of range\n", targ);
while (curline < ln) {
- if (getline(TRUE) == NULL)
+ if (getaline(TRUE) == NULL)
fatal("%s - out of range\n", targ);
flush();
}
} else /* last file */
- if (getline(TRUE) != NULL) {
+ if (getaline(TRUE) != NULL) {
flush();
for (;;) {
- if (getline(TRUE) == NULL)
+ if (getaline(TRUE) == NULL)
break;
flush();
}
@@ -591,7 +588,7 @@ static void
usage()
{
(void) fprintf(stderr, gettext(
- "usage: csplit [-ks] [-f prefix] [-n number] "
- "file arg1 ...argn\n"));
+ "usage: csplit [-ks] [-f prefix] [-n number] "
+ "file arg1 ...argn\n"));
exit(1);
}
diff --git a/usr/src/cmd/devctl/devctl.c b/usr/src/cmd/devctl/devctl.c
index 5516d51f14..15b76da9ac 100644
--- a/usr/src/cmd/devctl/devctl.c
+++ b/usr/src/cmd/devctl/devctl.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,14 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-
/*
* devctl - device control utility
*
@@ -107,7 +103,7 @@ typedef struct cmds {
extern int errno;
-static void setprogname(char *name);
+static void setpname(char *name);
static void print_bus_state(char *devname, uint_t state);
static void print_dev_state(char *devname, uint_t state);
static int dev_getstate(devctl_hdl_t);
@@ -191,7 +187,7 @@ main(int argc, char *argv[])
devctl_hdl_t dcp;
struct stat stat_buf;
- setprogname(argv[0]);
+ setpname(argv[0]);
while ((c = getopt(argc, argv, "vd")) != -1) {
switch (c) {
case 'v':
@@ -255,8 +251,8 @@ main(int argc, char *argv[])
if ((pathlen = readlink(orig_path, devctl_device,
MAXPATHLEN)) == -1) {
(void) fprintf(stderr,
- "devctl: readlink(%s) - %s\n",
- orig_path, strerror(errno));
+ "devctl: readlink(%s) - %s\n",
+ orig_path, strerror(errno));
exit(-1);
}
devctl_device[pathlen] = '\0';
@@ -308,16 +304,16 @@ main(int argc, char *argv[])
dcp = devctl_pm_dev_acquire(devctl_device, 0);
if (dcp == NULL) {
(void) fprintf(stderr,
- "devctl: device_pm_dev_acquire %s - %s\n",
- devctl_device, strerror(errno));
+ "devctl: device_pm_dev_acquire %s - %s\n",
+ devctl_device, strerror(errno));
exit(-1);
}
} else {
dcp = devctl_device_acquire(devctl_device, 0);
if (dcp == NULL) {
(void) fprintf(stderr,
- "devctl: device_acquire %s - %s\n",
- devctl_device, strerror(errno));
+ "devctl: device_acquire %s - %s\n",
+ devctl_device, strerror(errno));
exit(-1);
}
}
@@ -516,7 +512,7 @@ print_dev_state(char *devname, uint_t state)
}
static void
-setprogname(char *name)
+setpname(char *name)
{
register char *p;
diff --git a/usr/src/cmd/diff3/diff3prog.c b/usr/src/cmd/diff3/diff3prog.c
index 085a93eee3..0eb5d6b2e8 100644
--- a/usr/src/cmd/diff3/diff3prog.c
+++ b/usr/src/cmd/diff3/diff3prog.c
@@ -18,16 +18,13 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
#include <stdio.h>
#include <stdlib.h>
@@ -105,7 +102,7 @@ static int readin(char *name, struct diff *dd);
static int number(char **lc);
static int digit(int c);
static int getchange(FILE *b);
-static int getline(FILE *b);
+static int getaline(FILE *b);
static void merge(int m1, int m2);
static void separate(char *s);
static void change(int i, struct range *rold, int dup);
@@ -154,9 +151,9 @@ main(int argc, char **argv)
usage();
if (oflag) {
(void) snprintf(f1mark, sizeof (f1mark), "<<<<<<< %s",
- argc >= 7 ? argv[6] : argv[3]);
+ argc >= 7 ? argv[6] : argv[3]);
(void) snprintf(f3mark, sizeof (f3mark), ">>>>>>> %s",
- argc >= 8 ? argv[7] : argv[5]);
+ argc >= 8 ? argv[7] : argv[5]);
}
m = readin(argv[1], d13);
@@ -165,7 +162,7 @@ main(int argc, char **argv)
if ((fp[i] = fopen(argv[i+3], "r")) == NULL) {
save_err = errno;
(void) fprintf(stderr, "diff3: can't open %s: ",
- argv[i+3]);
+ argv[i+3]);
errno = save_err;
perror("");
exit(1);
@@ -250,14 +247,14 @@ digit(int c)
static int
getchange(FILE *b)
{
- while (getline(b))
+ while (getaline(b))
if (digit(line[0]))
return (1);
return (0);
}
static int
-getline(FILE *b)
+getaline(FILE *b)
{
int i, c;
for (i = 0; i < sizeof (line)-1; i++) {
@@ -288,10 +285,10 @@ merge(int m1, int m2)
for (; (t1 = d1 < d13+m1) | (t2 = d2 < d23+m2); ) {
if (debug) {
(void) printf("%d,%d=%d,%d %d,%d=%d,%d\n",
- d1->old.from, d1->old.to,
- d1->new.from, d1->new.to,
- d2->old.from, d2->old.to,
- d2->new.from, d2->new.to);
+ d1->old.from, d1->old.to,
+ d1->new.from, d1->new.to,
+ d2->old.from, d2->old.to,
+ d2->new.from, d2->new.to);
}
/* first file is different from others */
@@ -454,7 +451,7 @@ skip(int i, int from, char *pr)
{
int j, n;
for (n = 0; cline[i] < from-1; n += j) {
- if ((j = getline(fp[i])) == 0)
+ if ((j = getaline(fp[i])) == 0)
trouble();
if (pr)
(void) printf("%s%s", pr, line);
diff --git a/usr/src/cmd/dis/dis_target.c b/usr/src/cmd/dis/dis_target.c
index e27a307bc0..54eb8a3bb5 100644
--- a/usr/src/cmd/dis/dis_target.c
+++ b/usr/src/cmd/dis/dis_target.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <assert.h>
@@ -100,10 +99,9 @@ struct dis_scn {
Elf_Data *ds_data;
};
-/* Lifted from Psymtab.c */
+/* Lifted from Psymtab.c, omitting STT_TLS */
#define DATA_TYPES \
- ((1 << STT_OBJECT) | (1 << STT_FUNC) | \
- (1 << STT_COMMON) | (1 << STT_TLS))
+ ((1 << STT_OBJECT) | (1 << STT_FUNC) | (1 << STT_COMMON))
#define IS_DATA_TYPE(tp) (((1 << (tp)) & DATA_TYPES) != 0)
/*
diff --git a/usr/src/cmd/ed/ed.c b/usr/src/cmd/ed/ed.c
index 48fe227631..06dde94ba2 100644
--- a/usr/src/cmd/ed/ed.c
+++ b/usr/src/cmd/ed/ed.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,16 +18,13 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
/*
* Editor
@@ -331,7 +327,7 @@ static void nonzero(void);
static void setzeroasone(void);
static long putline(void);
static LINE address(void);
-static char *getline(long);
+static char *getaline(long);
static char *getblock(long, long);
static char *place(char *, char *, char *);
static void comple(wchar_t);
@@ -693,7 +689,7 @@ swch:
putd();
putchr('\t');
}
- puts(getline((a1++)->cur));
+ puts(getaline((a1++)->cur));
}
while (a1 <= addr2);
dot = addr2;
@@ -1441,7 +1437,7 @@ putfile(void)
fp = genbuf;
a1 = addr1;
do {
- lp = getline(a1++->cur);
+ lp = getaline(a1++->cur);
if (fss.Ffill && fss.Flim && lenchk(linebuf, &fss) < 0) {
write(1, gettext("line too long: lno = "),
strlen(gettext("line too long: lno = ")));
@@ -1676,7 +1672,7 @@ gdelete(void)
}
static char *
-getline(long tl)
+getaline(long tl)
{
char *bp, *lp;
int nl;
@@ -1911,7 +1907,7 @@ join(void)
return;
gp = genbuf;
for (a1 = addr1; a1 <= addr2; a1++) {
- lp = getline(a1->cur);
+ lp = getaline(a1->cur);
while (*gp = *lp++)
if (gp++ > &genbuf[LBSIZE-1])
(void) error(27);
@@ -2259,7 +2255,7 @@ getcopy(void)
if (addr1 > addr2)
return (EOF);
- (void) getline((addr1++)->cur);
+ (void) getaline((addr1++)->cur);
return (0);
}
@@ -2292,7 +2288,7 @@ execute(int gf, LINE addr)
else {
if (addr == zero)
return (0);
- p1 = getline(addr->cur);
+ p1 = getaline(addr->cur);
locs = 0;
}
return (step(p1, expbuf));
@@ -2595,7 +2591,7 @@ globaln(int k)
if (a1->cur & 01) {
a1->cur &= ~01;
dot = a1;
- puts(getline(a1->cur));
+ puts(getaline(a1->cur));
if ((c = get_wchr()) == EOF)
(void) error(52);
if (c == 'a' || c == 'i' || c == 'c')
diff --git a/usr/src/cmd/eeprom/common/error.c b/usr/src/cmd/eeprom/common/error.c
index c7bf4cf14b..a92ab86c92 100644
--- a/usr/src/cmd/eeprom/common/error.c
+++ b/usr/src/cmd/eeprom/common/error.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,11 +18,9 @@
*
* CDDL HEADER END
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
/*
- * Copyright 1989-2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <stdio.h>
@@ -36,7 +33,7 @@
char *progname;
void
-setprogname(char *name)
+setpname(char *name)
{
register char *p = name, c;
diff --git a/usr/src/cmd/eeprom/i386/benv.c b/usr/src/cmd/eeprom/i386/benv.c
index b0c55a05a2..f032a3e064 100644
--- a/usr/src/cmd/eeprom/i386/benv.c
+++ b/usr/src/cmd/eeprom/i386/benv.c
@@ -18,6 +18,7 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -39,7 +40,7 @@
extern void get_kbenv(void);
extern void close_kbenv(void);
extern caddr_t get_propval(char *name, char *node);
-extern void setprogname(char *prog);
+extern void setpname(char *prog);
extern char *getbootcmd(void);
char *boottree;
@@ -1052,7 +1053,7 @@ main(int argc, char **argv)
benv_des_t *bd;
char *file = NULL;
- setprogname(argv[0]);
+ setpname(argv[0]);
while ((c = getopt(argc, argv, "f:Itv")) != -1)
switch (c) {
diff --git a/usr/src/cmd/eeprom/sparc/openprom.c b/usr/src/cmd/eeprom/sparc/openprom.c
index d23fa6fe62..31043ea172 100644
--- a/usr/src/cmd/eeprom/sparc/openprom.c
+++ b/usr/src/cmd/eeprom/sparc/openprom.c
@@ -1,7 +1,9 @@
/*
* Open Boot Prom eeprom utility
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ */
+
+/*
+ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -42,7 +44,7 @@ typedef union {
} Oppbuf;
extern int _error(int do_perror, char *fmt, ...);
-extern void setprogname(char *);
+extern void setpname(char *);
static int get_password(char *, int);
extern int loadlogo(char *, int, int, char *);
@@ -133,7 +135,7 @@ main(int argc, char **argv)
"[variable[=value] ...]", argv[0]));
}
- setprogname(argv[0]);
+ setpname(argv[0]);
/*
* If no arguments, dump all fields.
diff --git a/usr/src/cmd/env/env.c b/usr/src/cmd/env/env.c
index bbd146bc62..ff2b2c4b31 100644
--- a/usr/src/cmd/env/env.c
+++ b/usr/src/cmd/env/env.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,23 +18,22 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
- * All Rights Reserved
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
+ * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+ * All Rights Reserved
*/
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */
-
/*
* env [ - ] [ name=value ]... [command arg...]
* set environment, then execute command (or print environment)
* - says start fresh, otherwise merge with inherited environment
*/
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -49,7 +47,6 @@
static void Usage();
-static char *nullp = NULL;
extern char **environ;
@@ -70,7 +67,7 @@ main(int argc, char **argv)
/* check for non-standard "-" option */
if ((argc > 1) && (strcmp(argv[1], "-")) == 0) {
- environ = &nullp;
+ (void) clearenv();
for (i = 1; i < argc; i++)
argv[i] = argv[i+1];
argc--;
@@ -80,7 +77,7 @@ main(int argc, char **argv)
while ((opt = getopt(argc, argv, "i")) != EOF) {
switch (opt) {
case 'i':
- environ = &nullp;
+ (void) clearenv();
break;
default:
diff --git a/usr/src/cmd/eqn/io.c b/usr/src/cmd/eqn/io.c
index 3aaf5d8092..129f8ab604 100644
--- a/usr/src/cmd/eqn/io.c
+++ b/usr/src/cmd/eqn/io.c
@@ -1,6 +1,5 @@
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -12,8 +11,6 @@
* specifies the terms and conditions for redistribution.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "e.h"
#include <stdlib.h>
#include <locale.h>
@@ -27,7 +24,7 @@ void error(int, char *, char *);
static void do_inline(void);
int eqn(int, char *[]);
-static int getline(char *);
+static int getaline(char *);
static void init(void);
void nrwid(int, int, int);
int oalloc(void);
@@ -53,7 +50,7 @@ eqn(int argc, char *argv[])
setfile(argc, argv);
init_tbl(); /* install keywords in tables */
- while ((type = getline(in)) != EOF) {
+ while ((type = getaline(in)) != EOF) {
eqline = linect;
if (in[0] == '.' && in[1] == 'E' && in[2] == 'Q') {
for (i = 11; i < 100; used[i++] = 0)
@@ -96,7 +93,7 @@ eqn(int argc, char *argv[])
}
static int
-getline(char *s)
+getaline(char *s)
{
int c;
while ((*s++ = c = gtc()) != '\n' && c != EOF && c != lefteq)
@@ -130,7 +127,7 @@ do_inline(void)
ofree(eqnreg);
}
printf(".ps \\n(99\n.ft \\n(98\n");
- } while (getline(in) == lefteq);
+ } while (getaline(in) == lefteq);
if (*in)
printf(".as %d \"%s", ds, in);
printf(".ps \\n(99\n.ft \\n(98\n");
diff --git a/usr/src/cmd/fm/fmd/common/fmd_idspace.c b/usr/src/cmd/fm/fmd/common/fmd_idspace.c
index 187dd3b67d..ce0f90563e 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_idspace.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_idspace.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <fmd_alloc.h>
#include <fmd_subr.h>
#include <fmd_conf.h>
@@ -34,47 +31,6 @@
#include <fmd_idspace.h>
#include <fmd.h>
-static int
-highbit(ulong_t i)
-{
- int h = 1;
-
- if (i == 0)
- return (0);
-
-#ifdef _LP64
- if (i & 0xffffffff00000000ul) {
- h += 32;
- i >>= 32;
- }
-#endif
-
- if (i & 0xffff0000) {
- h += 16;
- i >>= 16;
- }
-
- if (i & 0xff00) {
- h += 8;
- i >>= 8;
- }
-
- if (i & 0xf0) {
- h += 4;
- i >>= 4;
- }
-
- if (i & 0xc) {
- h += 2;
- i >>= 2;
- }
-
- if (i & 0x2)
- h += 1;
-
- return (h);
-}
-
fmd_idspace_t *
fmd_idspace_create(const char *name, id_t min, id_t max)
{
@@ -93,7 +49,7 @@ fmd_idspace_create(const char *name, id_t min, id_t max)
(void) fmd_conf_getprop(fmd.d_conf, "ids.max", &ids_max);
hashmax = max - min + 1;
- hashlen = 1 << highbit(hashmax / ids_avg);
+ hashlen = 1 << fls(hashmax / ids_avg);
if (hashlen > ids_max)
hashlen = ids_max;
diff --git a/usr/src/cmd/fm/fmd/common/fmd_module.c b/usr/src/cmd/fm/fmd/common/fmd_module.c
index 79db40e65e..ad3b8f424d 100644
--- a/usr/src/cmd/fm/fmd/common/fmd_module.c
+++ b/usr/src/cmd/fm/fmd/common/fmd_module.c
@@ -958,8 +958,7 @@ fmd_module_dc_opendict(fmd_module_t *mp, const char *dict)
ASSERT(fmd_module_locked(mp));
- dictnam = alloca(strlen(dict) + 1);
- (void) strcpy(dictnam, fmd_strbasename(dict));
+ dictnam = strdupa(fmd_strbasename(dict));
if ((p = strrchr(dictnam, '.')) != NULL &&
strcmp(p, ".dict") == 0)
diff --git a/usr/src/cmd/fm/modules/common/ip-transport/ip.c b/usr/src/cmd/fm/modules/common/ip-transport/ip.c
index fc2e2f3abd..e338dd7f3e 100644
--- a/usr/src/cmd/fm/modules/common/ip-transport/ip.c
+++ b/usr/src/cmd/fm/modules/common/ip-transport/ip.c
@@ -34,7 +34,6 @@
#include <strings.h>
#include <unistd.h>
#include <pthread.h>
-#include <alloca.h>
#include <fcntl.h>
#include <errno.h>
#include <netdb.h>
@@ -1028,8 +1027,7 @@ _fmd_init(fmd_hdl_t *hdl)
(void) nvlist_add_uint8(ip_auth,
FM_VERSION, FM_FMRI_AUTH_VERSION);
- s = alloca(strlen(auth) + 1);
- (void) strcpy(s, auth);
+ s = strdupa(auth);
fmd_prop_free_string(hdl, auth);
for (p = strtok_r(s, ",", &q); p != NULL;
diff --git a/usr/src/cmd/format/label.c b/usr/src/cmd/format/label.c
index 4740baebb2..3da51d9cc7 100644
--- a/usr/src/cmd/format/label.c
+++ b/usr/src/cmd/format/label.c
@@ -18,22 +18,15 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* This file contains the code relating to label manipulation.
*/
-#include "global.h"
-#include "label.h"
-#include "misc.h"
-#include "main.h"
-#include "partition.h"
-#include "ctlr_scsi.h"
-#include "checkdev.h"
#include <string.h>
#include <stdlib.h>
#include <memory.h>
@@ -43,6 +36,13 @@
#include <sys/uuid.h>
#include <errno.h>
#include <devid.h>
+#include "global.h"
+#include "label.h"
+#include "misc.h"
+#include "main.h"
+#include "partition.h"
+#include "ctlr_scsi.h"
+#include "checkdev.h"
#if defined(_FIRMWARE_NEEDS_FDISK)
#include <sys/dktp/fdisk.h>
diff --git a/usr/src/cmd/format/modify_partition.c b/usr/src/cmd/format/modify_partition.c
index b2bc580e69..02fee8c67b 100644
--- a/usr/src/cmd/format/modify_partition.c
+++ b/usr/src/cmd/format/modify_partition.c
@@ -18,14 +18,16 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* This file contains functions to implement the partition menu commands.
*/
+#include <stdlib.h>
+#include <string.h>
#include "global.h"
#include "partition.h"
#include "menu_partition.h"
@@ -36,9 +38,6 @@
#include "label.h"
#include "auto_sense.h"
-#include <stdlib.h>
-#include <string.h>
-
#ifdef __STDC__
/* Function prototypes for ANSI C Compilers */
diff --git a/usr/src/cmd/format/partition.c b/usr/src/cmd/format/partition.c
index 11ae4488a1..3d06272904 100644
--- a/usr/src/cmd/format/partition.c
+++ b/usr/src/cmd/format/partition.c
@@ -18,21 +18,21 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* This file contains functions that operate on partition tables.
*/
+#include <string.h>
+#include <stdlib.h>
#include "global.h"
#include "partition.h"
#include "misc.h"
#include "menu_command.h"
#include "menu_partition.h"
-#include <string.h>
-#include <stdlib.h>
/*
diff --git a/usr/src/cmd/fps/Makefile b/usr/src/cmd/fps/Makefile
index 3ea353c733..b6430ed033 100644
--- a/usr/src/cmd/fps/Makefile
+++ b/usr/src/cmd/fps/Makefile
@@ -19,8 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
include ../Makefile.cmd
@@ -42,16 +41,12 @@ all clean clobber install lint _msg: $(SUBDIRS)
check: fpsd
#
-# Note that the compilation of fptest is handled differently.
-# If the primary compiler is not a Sun Studio compiler, fptest will
-# *not* be compiled. This is because fptest is dependent on some Sun
+# The compilation of fptest is forced to be done with the Sun
+# Studio compiler. This is because fptest is dependent on some Sun
# performance libraries provided as part of the Sun Studio compiler
-# installation. fptest statically links libsunperf.a, libfui.a,
-# libfai.a, libfsu.a, and libsunmath.a. The other SUBDIRS will be
-# compiled.
-#
-# If the make macro __GNUC is "#", it means Sun Studio compiler is being
-# used for the compilation.
+# installation. fptest statically links libsunperf.a, libfui.a,
+# libfai.a, libfsu.a, and libsunmath.a. The other SUBDIRS will be
+# compiled normally.
#
$(SUBDIRS): FRC
@@ -63,14 +58,11 @@ $(SUBDIRS): FRC
*) \
if [ $@ != fptest ]; \
then \
- cd $@; pwd; VERSION='$(VERSION)' $(MAKE) \
- $(TARGET); \
+ cd $@; pwd; VERSION='$(VERSION)' \
+ $(MAKE) $(TARGET); \
else \
- if [ "$(__GNUC)" = "#" ]; \
- then \
- cd $@; pwd; VERSION='$(VERSION)' \
- $(MAKE) $(TARGET); \
- fi \
+ cd $@; pwd; VERSION='$(VERSION)' \
+ $(MAKE) __GNUC=$(POUND_SIGN) $(TARGET); \
fi \
;; \
esac
diff --git a/usr/src/cmd/fs.d/nfs/lib/nfslog_config.c b/usr/src/cmd/fs.d/nfs/lib/nfslog_config.c
index 5b89c0b581..aff081912b 100644
--- a/usr/src/cmd/fs.d/nfs/lib/nfslog_config.c
+++ b/usr/src/cmd/fs.d/nfs/lib/nfslog_config.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 1999 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <ctype.h>
#include <errno.h>
#include <locale.h>
@@ -90,7 +87,7 @@ static void complete_with_global(char **, char **, char **, char **,
static void remove_config(nfsl_config_t **, nfsl_config_t *, nfsl_config_t **);
void nfsl_printconfig(nfsl_config_t *);
#endif /* DEBUG */
-static char *getline(FILE *, char *, char *, int);
+static char *gataline(FILE *, char *, char *, int);
static int get_info(char *, char **, char **, char **, char **, char **,
char **, int *);
static void free_config(nfsl_config_t *);
@@ -286,7 +283,7 @@ getconfiglist(nfsl_config_t **listpp, boolean_t updating)
assert (*listpp != NULL);
tail = getlastconfig(*listpp);
- while (getline(fp, NFSL_CONFIG_FILE_PATH, linebuf, sizeof (linebuf))) {
+ while (gataline(fp, NFSL_CONFIG_FILE_PATH, linebuf, sizeof (linebuf))) {
if (linebuf[0] == '\0') {
/*
* ignore lines that exceed max size
@@ -939,13 +936,13 @@ is_legal_tag(char *tag)
}
/*
- * getline attempts to get a line from the configuration file,
+ * gataline attempts to get a line from the configuration file,
* upto LINESZ. A line in the file is a concatenation of lines if the
* continuation symbol '\' is used at the end of the line. Returns
* line on success, a NULL on EOF, and an empty string on lines > linesz.
*/
static char *
-getline(FILE *fp, char *path, char *line, int linesz) {
+gataline(FILE *fp, char *path, char *line, int linesz) {
register char *p = line;
register int len;
int excess = 0;
diff --git a/usr/src/cmd/fs.d/udfs/fsck/utilities.c b/usr/src/cmd/fs.d/udfs/fsck/utilities.c
index c39845c7b3..2deb71a9eb 100644
--- a/usr/src/cmd/fs.d/udfs/fsck/utilities.c
+++ b/usr/src/cmd/fs.d/udfs/fsck/utilities.c
@@ -1,6 +1,5 @@
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -25,8 +24,6 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
@@ -64,7 +61,7 @@ static struct bufarea *getblk(struct bufarea *, daddr_t, long);
void flush(int32_t, struct bufarea *);
int32_t bread(int32_t, char *, daddr_t, long);
void bwrite(int, char *, daddr_t, long);
-static int32_t getline(FILE *, char *, int32_t);
+static int32_t getaline(FILE *, char *, int32_t);
void errexit(char *, ...) __NORETURN;
static long diskreads, totalreads; /* Disk cache statistics */
offset_t llseek();
@@ -86,7 +83,7 @@ pfatal(char *fmt, ...)
(void) printf("\n");
(void) printf(
gettext("%s: UNEXPECTED INCONSISTENCY; RUN fsck "
- "MANUALLY.\n"), devname);
+ "MANUALLY.\n"), devname);
va_end(args);
exit(36);
}
@@ -172,7 +169,7 @@ getfilentry(uint32_t block, int len)
if (len > fsbsize) {
(void) printf(gettext("File entry at %x is too long "
- "(%d bytes)\n"), block, len);
+ "(%d bytes)\n"), block, len);
len = fsbsize;
}
bp = getdatablk((daddr_t)(block + part_start), fsbsize);
@@ -185,7 +182,7 @@ getfilentry(uint32_t block, int len)
err = verifytag(&fp->fe_tag, block, &fp->fe_tag, UD_FILE_ENTRY);
if (err) {
(void) printf(gettext("Tag error %s or bad file entry, "
- "tag=%d\n"), tagerrs[err], fp->fe_tag.tag_id);
+ "tag=%d\n"), tagerrs[err], fp->fe_tag.tag_id);
bp->b_flags &= ~B_INUSE;
return (NULL);
}
@@ -220,7 +217,7 @@ reply(char *question)
(void) printf(gettext(" yes\n\n"));
return (1);
}
- if (getline(stdin, line, sizeof (line)) == EOF)
+ if (getaline(stdin, line, sizeof (line)) == EOF)
errexit("\n");
(void) printf("\n");
if (line[0] == 'y' || line[0] == 'Y')
@@ -232,7 +229,7 @@ reply(char *question)
}
int32_t
-getline(FILE *fp, char *loc, int32_t maxlen)
+getaline(FILE *fp, char *loc, int32_t maxlen)
{
int n;
register char *p, *lastloc;
@@ -337,7 +334,7 @@ flush(int32_t fd, struct bufarea *bp)
return;
if (bp->b_errs != 0)
pfatal(gettext("WRITING ZERO'ED BLOCK %d TO DISK\n"),
- bp->b_bno);
+ bp->b_bno);
bp->b_dirty = 0;
bp->b_errs = 0;
bwrite(fd, bp->b_un.b_buf, bp->b_bno, (long)bp->b_size);
@@ -370,7 +367,7 @@ ckfini()
pbp = pdirbp = NULL;
if (bufhead.b_size != cnt)
errexit(gettext("Panic: lost %d buffers\n"),
- bufhead.b_size - cnt);
+ bufhead.b_size - cnt);
if (debug)
(void) printf("cache missed %ld of %ld (%ld%%)\n",
diskreads, totalreads,
@@ -461,7 +458,7 @@ catchquit()
extern int returntosingle;
(void) printf(gettext("returning to single-user after filesystem "
- "check\n"));
+ "check\n"));
returntosingle = 1;
(void) signal(SIGQUIT, SIG_DFL);
}
@@ -498,7 +495,7 @@ dofix(struct inodesc *idesc, char *msg)
default:
errexit(gettext("UNKNOWN INODESC FIX MODE %d\n"),
- idesc->id_fix);
+ idesc->id_fix);
}
/* NOTREACHED */
}
@@ -535,7 +532,7 @@ mounted(char *name)
continue;
if (device_stat.st_rdev == mount_stat.st_dev) {
(void) strncpy(mnt.mnt_mountp, mountpoint,
- sizeof (mountpoint));
+ sizeof (mountpoint));
if (hasmntopt(&mnt, MNTOPT_RO) != 0)
found = 2; /* mounted as RO */
else
diff --git a/usr/src/cmd/fs.d/ufs/fsck/utilities.c b/usr/src/cmd/fs.d/ufs/fsck/utilities.c
index 899402f0e0..d87830669a 100644
--- a/usr/src/cmd/fs.d/ufs/fsck/utilities.c
+++ b/usr/src/cmd/fs.d/ufs/fsck/utilities.c
@@ -1,6 +1,5 @@
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -70,7 +69,7 @@ static void vdirerror(fsck_ino_t, caddr_t, va_list);
static struct mnttab *search_mnttab(caddr_t, caddr_t, caddr_t, size_t);
static struct vfstab *search_vfstab(caddr_t, caddr_t, caddr_t, size_t);
static void vpwarn(caddr_t, va_list);
-static int getline(FILE *, caddr_t, int);
+static int getaline(FILE *, caddr_t, int);
static struct bufarea *alloc_bufarea(void);
static void rwerror(caddr_t, diskaddr_t, int rval);
static void debugclean(void);
@@ -156,7 +155,7 @@ reply(caddr_t fmt, ...)
return (1);
}
(void) fflush(stdout);
- if (getline(stdin, line, sizeof (line)) == EOF)
+ if (getaline(stdin, line, sizeof (line)) == EOF)
errexit("\n");
(void) printf("\n");
if (line[0] == 'y' || line[0] == 'Y') {
@@ -167,7 +166,7 @@ reply(caddr_t fmt, ...)
}
int
-getline(FILE *fp, caddr_t loc, int maxlen)
+getaline(FILE *fp, caddr_t loc, int maxlen)
{
int n;
caddr_t p, lastloc;
diff --git a/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c b/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c
index 70922cc33c..4fa2683a64 100644
--- a/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c
+++ b/usr/src/cmd/fs.d/ufs/mkfs/mkfs.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -420,7 +420,7 @@ static void block_sigint(sigset_t *old_mask);
static void unblock_sigint(sigset_t *old_mask);
static void recover_from_sigint(int signum);
static int confirm_abort(void);
-static int getline(FILE *fp, char *loc, int maxlen);
+static int getaline(FILE *fp, char *loc, int maxlen);
static void flush_writes(void);
static long compute_maxcpg(long, long, long, long, long);
static int in_64bit_mode(void);
@@ -5498,7 +5498,7 @@ confirm_abort(void)
"you will be given instructions on how to\nrecover "
"the filesystem. Do you wish to cancel the filesystem "
"grow\noperation (y/n)?"));
- if (getline(stdin, line, sizeof (line)) == EOF)
+ if (getaline(stdin, line, sizeof (line)) == EOF)
line[0] = 'y';
printf("\n");
@@ -5510,7 +5510,7 @@ confirm_abort(void)
}
static int
-getline(FILE *fp, char *loc, int maxlen)
+getaline(FILE *fp, char *loc, int maxlen)
{
int n;
char *p, *lastloc;
diff --git a/usr/src/cmd/idmap/idmap/idmap.c b/usr/src/cmd/idmap/idmap/idmap.c
index 290d2950f0..3be65fd6d9 100644
--- a/usr/src/cmd/idmap/idmap/idmap.c
+++ b/usr/src/cmd/idmap/idmap/idmap.c
@@ -18,11 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
@@ -1607,23 +1607,6 @@ cleanup:
}
/*
- * The same as strdup, but length chars is duplicated, no matter on
- * '\0'. The caller must guarantee "length" chars in "from".
- */
-static char *
-strndup(char *from, size_t length)
-{
- char *out = (char *)malloc(length + 1);
- if (out == NULL) {
- print_error(NULL, gettext("Not enough memory\n"));
- return (NULL);
- }
- (void) strncpy(out, from, length);
- out[length] = '\0';
- return (out);
-}
-
-/*
* Convert pid from string to it's numerical representation. If it is
* a valid string, i.e. number of a proper length, return 1. Otherwise
* print an error message and return 0.
diff --git a/usr/src/cmd/ipf/lib/common/getline.c b/usr/src/cmd/ipf/lib/common/getline.c
index 7d06d4367b..79e7f09bce 100644
--- a/usr/src/cmd/ipf/lib/common/getline.c
+++ b/usr/src/cmd/ipf/lib/common/getline.c
@@ -18,17 +18,14 @@
* Similar to fgets(3) but can handle '\\' and NL is converted to NUL.
* Returns NULL if error occured, EOF encounterd or input line is too long.
*/
-char *getline(str, size, file, linenum)
-register char *str;
-size_t size;
-FILE *file;
-int *linenum;
+char *
+getaline(char *str, size_t size, FILE *file, int *linenum)
{
char *p;
int s, len;
do {
- for (p = str, s = size;; p += (len - 1), s -= (len - 1)) {
+ for (p = str, s = size; ; p += (len - 1), s -= (len - 1)) {
/*
* if an error occured, EOF was encounterd, or there
* was no room to put NUL, return NULL.
diff --git a/usr/src/cmd/ldap/common/ldaptest.c b/usr/src/cmd/ldap/common/ldaptest.c
index 66f18bc2ad..d6024b5490 100644
--- a/usr/src/cmd/ldap/common/ldaptest.c
+++ b/usr/src/cmd/ldap/common/ldaptest.c
@@ -1,12 +1,7 @@
/*
- *
- * Portions Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <ctype.h>
#include <string.h>
@@ -40,7 +35,7 @@ static void free_list();
char *dnsuffix;
static char *
-getline( char *line, int len, FILE *fp, char *prompt )
+getaline( char *line, int len, FILE *fp, char *prompt )
{
printf(prompt);
@@ -62,7 +57,7 @@ get_list( char *prompt )
num = 0;
result = (char **) 0;
while ( 1 ) {
- getline( buf, sizeof(buf), stdin, prompt );
+ getaline( buf, sizeof(buf), stdin, prompt );
if ( *buf == '\0' )
break;
@@ -161,14 +156,14 @@ get_modlist( char *prompt1, char *prompt2, char *prompt3 )
result = NULL;
while ( 1 ) {
if ( prompt1 ) {
- getline( buf, sizeof(buf), stdin, prompt1 );
+ getaline( buf, sizeof(buf), stdin, prompt1 );
tmp.mod_op = atoi( buf );
if ( tmp.mod_op == -1 || buf[0] == '\0' )
break;
}
- getline( buf, sizeof(buf), stdin, prompt2 );
+ getaline( buf, sizeof(buf), stdin, prompt2 );
if ( buf[0] == '\0' )
break;
tmp.mod_type = strdup( buf );
@@ -229,7 +224,7 @@ bind_prompt( LDAP *ld, char **dnp, char **passwdp, int *authmethodp,
if ( !freeit ) {
#ifdef KERBEROS
- getline( dn, sizeof(dn), stdin,
+ getaline( dn, sizeof(dn), stdin,
"re-bind method (0->simple, 1->krbv41, 2->krbv42, 3->krbv41&2)? " );
if (( *authmethodp = atoi( dn )) == 3 ) {
*authmethodp = LDAP_AUTH_KRBV4;
@@ -240,12 +235,12 @@ bind_prompt( LDAP *ld, char **dnp, char **passwdp, int *authmethodp,
*authmethodp = LDAP_AUTH_SIMPLE;
#endif /* KERBEROS */
- getline( dn, sizeof(dn), stdin, "re-bind dn? " );
+ getaline( dn, sizeof(dn), stdin, "re-bind dn? " );
strcat( dn, dnsuffix );
*dnp = dn;
if ( *authmethodp == LDAP_AUTH_SIMPLE && dn[0] != '\0' ) {
- getline( passwd, sizeof(passwd), stdin,
+ getaline( passwd, sizeof(passwd), stdin,
"re-bind password? " );
} else {
passwd[0] = '\0';
@@ -394,7 +389,7 @@ main(int argc, char **argv )
timelimit.tv_usec = 0;
(void) memset( line, '\0', sizeof(line) );
- while ( getline( line, sizeof(line), stdin, "\ncommand? " ) != NULL ) {
+ while ( getaline( line, sizeof(line), stdin, "\ncommand? " ) != NULL ) {
command1 = line[0];
command2 = line[1];
command3 = line[2];
@@ -403,7 +398,7 @@ main(int argc, char **argv )
case 'a': /* add or abandon */
switch ( command2 ) {
case 'd': /* add */
- getline( dn, sizeof(dn), stdin, "dn? " );
+ getaline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
if ( (attrs = get_modlist( NULL, "attr? ",
"value? " )) == NULL )
@@ -424,7 +419,7 @@ main(int argc, char **argv )
break;
case 'b': /* abandon */
- getline( line, sizeof(line), stdin, "msgid? " );
+ getaline( line, sizeof(line), stdin, "msgid? " );
id = atoi( line );
if ( ldap_abandon( ld, id ) != 0 )
ldap_perror( ld, "ldap_abandon" );
@@ -438,17 +433,17 @@ main(int argc, char **argv )
case 'b': /* asynch bind */
#ifdef KERBEROS
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"method (0->simple, 1->krbv41, 2->krbv42)? " );
method = atoi( line ) | 0x80;
#else /* KERBEROS */
method = LDAP_AUTH_SIMPLE;
#endif /* KERBEROS */
- getline( dn, sizeof(dn), stdin, "dn? " );
+ getaline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
if ( method == LDAP_AUTH_SIMPLE && dn[0] != '\0' )
- getline( passwd, sizeof(passwd), stdin,
+ getaline( passwd, sizeof(passwd), stdin,
"password? " );
else
passwd[0] = '\0';
@@ -464,7 +459,7 @@ main(int argc, char **argv )
case 'B': /* synch bind */
#ifdef KERBEROS
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"method 0->simple 1->krbv41 2->krbv42 3->krb? " );
method = atoi( line );
if ( method == 3 )
@@ -472,12 +467,12 @@ main(int argc, char **argv )
else
method = method | 0x80;
#else /* KERBEROS */
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"method 0->simple, 1->SASL? ");
method = atoi (line);
if (method == 1){
method = LDAP_AUTH_SASL;
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"mechanism 0->CRAM_MD5, 1->TLS? ");
theInt = atoi(line);
if (theInt == 0){
@@ -491,11 +486,11 @@ main(int argc, char **argv )
}
#endif /* KERBEROS */
- getline( dn, sizeof(dn), stdin, "dn? " );
+ getaline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
if ( dn[0] != '\0' )
- getline( passwd, sizeof(passwd), stdin,
+ getaline( passwd, sizeof(passwd), stdin,
"password? " );
else
passwd[0] = '\0';
@@ -531,10 +526,10 @@ main(int argc, char **argv )
break;
case 'c': /* compare */
- getline( dn, sizeof(dn), stdin, "dn? " );
+ getaline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
- getline( attr, sizeof(attr), stdin, "attr? " );
- getline( value, sizeof(value), stdin, "value? " );
+ getaline( attr, sizeof(attr), stdin, "attr? " );
+ getaline( value, sizeof(value), stdin, "value? " );
if (ldap_get_option(ld, LDAP_OPT_PROTOCOL_VERSION, &i) == LDAP_SUCCESS && i == LDAP_VERSION3){
bv.bv_val = value;
@@ -553,7 +548,7 @@ main(int argc, char **argv )
case 'd': /* turn on debugging */
#ifdef LDAP_DEBUG
- getline( line, sizeof(line), stdin, "debug level? " );
+ getaline( line, sizeof(line), stdin, "debug level? " );
ldap_debug = atoi( line );
if ( ldap_debug & LDAP_DEBUG_PACKETS ) {
lber_debug = ldap_debug;
@@ -564,7 +559,7 @@ main(int argc, char **argv )
break;
case 'E': /* explode a dn */
- getline( line, sizeof(line), stdin, "dn? " );
+ getaline( line, sizeof(line), stdin, "dn? " );
exdn = ldap_explode_dn( line, 0 );
for ( i = 0; exdn != NULL && exdn[i] != NULL; i++ ) {
printf( "\t%s\n", exdn[i] );
@@ -572,19 +567,19 @@ main(int argc, char **argv )
break;
case 'g': /* set next msgid */
- getline( line, sizeof(line), stdin, "msgid? " );
+ getaline( line, sizeof(line), stdin, "msgid? " );
ld->ld_msgid = atoi( line );
break;
case 'v': /* set version number */
- getline( line, sizeof(line), stdin, "version? " );
+ getaline( line, sizeof(line), stdin, "version? " );
theInt = atoi(line);
ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &theInt);
break;
case 'm': /* modify or modifyrdn */
if ( strncmp( line, "modify", 4 ) == 0 ) {
- getline( dn, sizeof(dn), stdin, "dn? " );
+ getaline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
if ( (mods = get_modlist(
"mod (0=>add, 1=>delete, 2=>replace -1=>done)? ",
@@ -604,10 +599,10 @@ main(int argc, char **argv )
printf( "Modify initiated with id %d\n", id );
}
} else if ( strncmp( line, "modrdn", 4 ) == 0 ) {
- getline( dn, sizeof(dn), stdin, "dn? " );
+ getaline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
- getline( rdn, sizeof(rdn), stdin, "newrdn? " );
- getline( line, sizeof(line), stdin, "delete old rdn (0=>no, 1=>yes)?");
+ getaline( rdn, sizeof(rdn), stdin, "newrdn? " );
+ getaline( line, sizeof(line), stdin, "delete old rdn (0=>no, 1=>yes)?");
delrdn = atoi(line);
if (ldap_get_option(ld, LDAP_OPT_PROTOCOL_VERSION, &i) == LDAP_SUCCESS && i == LDAP_VERSION3){
if ((err = ldap_rename(ld, dn, rdn, NULL, delrdn, NULL,NULL, &id)) != LDAP_SUCCESS){
@@ -640,13 +635,13 @@ main(int argc, char **argv )
case 'r': /* result or remove */
switch ( command3 ) {
case 's': /* result */
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"msgid (-1=>any)? " );
if ( line[0] == '\0' )
id = -1;
else
id = atoi( line );
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"all (0=>any, 1=>all)? " );
if ( line[0] == '\0' )
all = 1;
@@ -667,7 +662,7 @@ main(int argc, char **argv )
break;
case 'm': /* remove */
- getline( dn, sizeof(dn), stdin, "dn? " );
+ getaline( dn, sizeof(dn), stdin, "dn? " );
strcat( dn, dnsuffix );
if (ldap_get_option(ld, LDAP_OPT_PROTOCOL_VERSION, &i) == LDAP_SUCCESS && i == LDAP_VERSION3){
if ((err = ldap_delete_ext( ld, dn, NULL, NULL, &id )) != LDAP_SUCCESS )
@@ -689,21 +684,21 @@ main(int argc, char **argv )
break;
case 's': /* search */
- getline( dn, sizeof(dn), stdin, "searchbase? " );
+ getaline( dn, sizeof(dn), stdin, "searchbase? " );
strcat( dn, dnsuffix );
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"scope (0=Base, 1=One Level, 2=Subtree)? " );
scope = atoi( line );
- getline( filter, sizeof(filter), stdin,
+ getaline( filter, sizeof(filter), stdin,
"search filter (e.g. sn=jones)? " );
types = get_list( "attrs to return? " );
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"attrsonly (0=attrs&values, 1=attrs only)? " );
attrsonly = atoi( line );
if ( cldapflg ) {
#ifdef CLDAP
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Requestor DN (for logging)? " );
if ( cldap_search_s( ld, dn, scope, filter, types,
attrsonly, &res, line ) != 0 ) {
@@ -719,7 +714,7 @@ main(int argc, char **argv )
theInt = 0;
if (ldap_get_option(ld, LDAP_OPT_PROTOCOL_VERSION, &i) == LDAP_SUCCESS && i == LDAP_VERSION3){
resultusetimelimit = 1;
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"ldap_search_ext (0=>no, 1=>yes - default: yes)? " );
if (line[0] == '\0')
theInt = 1;
@@ -727,10 +722,10 @@ main(int argc, char **argv )
theInt = atoi( line );
}
if (theInt){
- getline(line, sizeof(line), stdin, "time limit?");
+ getaline(line, sizeof(line), stdin, "time limit?");
timelimit.tv_sec = atoi(line);
resultusetimelimit = 1;
- getline(line, sizeof(line), stdin, "size limit?");
+ getaline(line, sizeof(line), stdin, "size limit?");
sizelimit = atoi(line);
if (( err = ldap_search_ext(ld, dn, scope, filter, types, attrsonly, NULL, NULL,
&timelimit, sizelimit, &id)) != LDAP_SUCCESS){
@@ -751,20 +746,20 @@ main(int argc, char **argv )
break;
case 't': /* set timeout value */
- getline( line, sizeof(line), stdin, "timeout? " );
+ getaline( line, sizeof(line), stdin, "timeout? " );
timeout.tv_sec = atoi( line );
break;
case 'U': /* set ufn search prefix */
- getline( line, sizeof(line), stdin, "ufn prefix? " );
+ getaline( line, sizeof(line), stdin, "ufn prefix? " );
ldap_ufn_setprefix( ld, line );
break;
case 'u': /* user friendly search w/optional timeout */
- getline( dn, sizeof(dn), stdin, "ufn? " );
+ getaline( dn, sizeof(dn), stdin, "ufn? " );
strcat( dn, dnsuffix );
types = get_list( "attrs to return? " );
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"attrsonly (0=attrs&values, 1=attrs only)? " );
attrsonly = atoi( line );
@@ -787,10 +782,10 @@ main(int argc, char **argv )
break;
case 'l': /* URL search */
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"attrsonly (0=attrs&values, 1=attrs only)? " );
attrsonly = atoi( line );
- getline( line, sizeof(line), stdin, "LDAP URL? " );
+ getaline( line, sizeof(line), stdin, "LDAP URL? " );
if (( id = ldap_url_search( ld, line, attrsonly ))
== -1 ) {
ldap_perror( ld, "ldap_url_search" );
@@ -800,7 +795,7 @@ main(int argc, char **argv )
break;
case 'p': /* parse LDAP URL */
- getline( line, sizeof(line), stdin, "LDAP URL? " );
+ getaline( line, sizeof(line), stdin, "LDAP URL? " );
if (( i = ldap_url_parse( line, &ludp )) != 0 ) {
fprintf( stderr, "ldap_url_parse: error %d\n", i );
} else {
@@ -842,7 +837,7 @@ main(int argc, char **argv )
break;
case 'n': /* set dn suffix, for convenience */
- getline( line, sizeof(line), stdin, "DN suffix? " );
+ getaline( line, sizeof(line), stdin, "DN suffix? " );
strcpy( dnsuffix, line );
break;
@@ -850,9 +845,9 @@ main(int argc, char **argv )
#ifdef NO_CACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
- getline( line, sizeof(line), stdin, "Cache timeout (secs)? " );
+ getaline( line, sizeof(line), stdin, "Cache timeout (secs)? " );
i = atoi( line );
- getline( line, sizeof(line), stdin, "Maximum memory to use (bytes)? " );
+ getaline( line, sizeof(line), stdin, "Maximum memory to use (bytes)? " );
if ( ldap_enable_cache( ld, i, atoi( line )) == 0 ) {
printf( "local cache is on\n" );
} else {
@@ -865,7 +860,7 @@ main(int argc, char **argv )
#ifdef NO_CACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
- getline( line, sizeof(line), stdin, "DN? " );
+ getaline( line, sizeof(line), stdin, "DN? " );
ldap_uncache_entry( ld, line );
#endif /* NO_CACHE */
break;
@@ -874,33 +869,33 @@ main(int argc, char **argv )
#ifdef NO_CACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
- getline( line, sizeof(line), stdin, "request msgid? " );
+ getaline( line, sizeof(line), stdin, "request msgid? " );
ldap_uncache_request( ld, atoi( line ));
#endif /* NO_CACHE */
break;
case 'o': /* set ldap options */
- getline( line, sizeof(line), stdin, "alias deref (0=never, 1=searching, 2=finding, 3=always)?" );
+ getaline( line, sizeof(line), stdin, "alias deref (0=never, 1=searching, 2=finding, 3=always)?" );
theInt = atoi(line);
ldap_set_option(ld, LDAP_OPT_DEREF, &theInt );
- getline( line, sizeof(line), stdin, "timelimit?" );
+ getaline( line, sizeof(line), stdin, "timelimit?" );
theInt = atoi(line);
ldap_set_option(ld, LDAP_OPT_TIMELIMIT, &theInt);
- getline( line, sizeof(line), stdin, "sizelimit?" );
+ getaline( line, sizeof(line), stdin, "sizelimit?" );
theInt = atoi(line);
ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &theInt);
ld->ld_options = 0;
#ifdef STR_TRANSLATION
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Automatic translation of T.61 strings (0=no, 1=yes)?" );
if ( atoi( line ) == 0 ) {
ld->ld_lberoptions &= ~LBER_TRANSLATE_STRINGS;
} else {
ld->ld_lberoptions |= LBER_TRANSLATE_STRINGS;
#ifdef LDAP_CHARSET_8859
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Translate to/from ISO-8859 (0=no, 1=yes?" );
if ( atoi( line ) != 0 ) {
ldap_set_string_translators( ld,
@@ -912,18 +907,18 @@ main(int argc, char **argv )
#endif /* STR_TRANSLATION */
#ifdef LDAP_DNS
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Use DN & DNS to determine where to send requests (0=no, 1=yes)?" );
if ( atoi( line ) != 0 ) {
ld->ld_options |= LDAP_OPT_DNS;
}
#endif /* LDAP_DNS */
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Recognize and chase referrals (0=no, 1=yes)?" );
if ( atoi( line ) != 0 ) {
theInt = LDAP_OPT_ON;
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Prompt for bind credentials when chasing referrals (0=no, 1=yes)?" );
if ( atoi( line ) != 0 ) {
ldap_set_option( ld, LDAP_OPT_REBIND_FN, bind_prompt );
@@ -935,7 +930,7 @@ main(int argc, char **argv )
break;
case 'k': /* Set some controls */
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Set control: (0 for none, 1 for ManageDSA, 2 for preferredLang, 3 for BAD)?");
theInt = atoi(line);
switch (theInt){
@@ -949,7 +944,7 @@ main(int argc, char **argv )
ldap_set_option(ld, LDAP_OPT_SERVER_CONTROLS, ctrls);
break;
case 2:
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Preferred Language Control : lang ?");
aCtrl.ldctl_oid = "1.3.6.1.4.1.1466.20035";
aCtrl.ldctl_iscritical = 1;
@@ -959,7 +954,7 @@ main(int argc, char **argv )
ldap_set_option(ld, LDAP_OPT_SERVER_CONTROLS, ctrls);
break;
default:
- getline( line, sizeof(line), stdin,
+ getaline( line, sizeof(line), stdin,
"Bad Control is critical (0=false, 1=true)?");
aCtrl.ldctl_oid = "1.1.1.1.1.1";
aCtrl.ldctl_iscritical = atoi(line);
@@ -973,7 +968,7 @@ main(int argc, char **argv )
#ifdef NO_CACHE
printf( NOCACHEERRMSG );
#else /* NO_CACHE */
- getline( line, sizeof(line), stdin, "cache errors (0=smart, 1=never, 2=always)?" );
+ getaline( line, sizeof(line), stdin, "cache errors (0=smart, 1=never, 2=always)?" );
switch( atoi( line )) {
case 0:
ldap_set_cache_options( ld, 0 );
diff --git a/usr/src/cmd/mail/copymt.c b/usr/src/cmd/mail/copymt.c
index 75960842c5..3d2289a8b6 100644
--- a/usr/src/cmd/mail/copymt.c
+++ b/usr/src/cmd/mail/copymt.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,11 +18,14 @@
*
* CDDL HEADER END
*/
+
+/*
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
-#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 2.1 */
/*
NAME
copymt - copy mail (f1) to temp (f2)
@@ -62,7 +64,7 @@ register FILE *f1, *f2;
nextadr = let[nlet].adr;
}
- while ((n = getline(line, sizeof line, f1)) > 0) {
+ while ((n = getaline(line, sizeof line, f1)) > 0) {
if (!newline) {
goto putout;
} else if ((hdr = isheader (line, &ctf)) == FALSE) {
diff --git a/usr/src/cmd/mail/gethead.c b/usr/src/cmd/mail/gethead.c
index be671b8a23..3dcae88535 100644
--- a/usr/src/cmd/mail/gethead.c
+++ b/usr/src/cmd/mail/gethead.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,16 +18,14 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "mail.h"
#define MAXHDRSIZE 100 /* Maximum length of header line */
@@ -129,7 +126,8 @@ gethead(int current, int all)
}
/* skip past trailing white space after header tag */
- for (rc = 5; wline[rc] == ' ' || wline[rc] == '\t'; ++rc);
+ for (rc = 5; wline[rc] == ' ' || wline[rc] == '\t'; ++rc)
+ ;
(void) strlcpy(hold, wline + rc, MAXHDRSIZE);
fgets(wline, MAXHDRSIZE, file);
@@ -171,12 +169,15 @@ gethead(int current, int all)
* delimiting white space.
*/
for (; hold[rc] != '\0' && hold[rc] != ' ' &&
- hold[rc] != '\t'; ++rc);
- for (; hold[rc] == ' ' || hold[rc] == '\t'; ++rc);
+ hold[rc] != '\t'; ++rc)
+ ;
+ for (; hold[rc] == ' ' || hold[rc] == '\t'; ++rc)
+ ;
/* Get the date information. */
(void) strlcpy(wline, hold + rc, MAXHDRSIZE);
- for (rc = 0; wline[rc] != '\0' && wline[rc] != '\n'; ++rc);
+ for (rc = 0; wline[rc] != '\0' && wline[rc] != '\n'; ++rc)
+ ;
wline[rc] = '\0';
if (!flgh && current == ln) mark = '>';
@@ -224,7 +225,7 @@ wtmpf(char *str, int length)
* return number of bytes in length
*/
int
-getline(char *ptr2line, int max, FILE *f)
+getaline(char *ptr2line, int max, FILE *f)
{
int i, ch;
for (i = 0; i < max-1 && (ch = getc(f)) != EOF; )
@@ -243,9 +244,9 @@ mktmp(void)
int fd = mkstemp(lettmp = tmpl);
if (fd < 0 || (tmpf = fdopen(fd, "w+")) == NULL) {
- fprintf(stderr,
+ fprintf(stderr,
"%s: Can't open '%s', type: w+\n", program, lettmp);
- done(0);
+ done(0);
}
}
diff --git a/usr/src/cmd/mail/mail.h b/usr/src/cmd/mail/mail.h
index 08dbd66d75..8371d520d6 100644
--- a/usr/src/cmd/mail/mail.h
+++ b/usr/src/cmd/mail/mail.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
#ifndef _MAIL_H
#define _MAIL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* All global externs defined here. All variables are initialized
* in init.c
@@ -304,7 +301,7 @@ extern int findSurg(int letnum, string *execbuf, int flag, int *psurr_num, int *
extern void gendeliv(FILE *fp, int rc, char *name);
extern int getcomment(char *s, char *q);
extern int gethead(int current, int all);
-extern int getline(char *ptr2line, int max, FILE *f);
+extern int getaline(char *ptr2line, int max, FILE *f);
extern int getnumbr(char *s);
extern int getsurr(FILE *fp, string *buf, int firstfield);
extern void goback(int letnum);
diff --git a/usr/src/cmd/mail/sendmail.c b/usr/src/cmd/mail/sendmail.c
index 976dc275fa..9bd6444b6a 100644
--- a/usr/src/cmd/mail/sendmail.c
+++ b/usr/src/cmd/mail/sendmail.c
@@ -18,16 +18,13 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
#include "mail.h"
#include <sys/param.h>
@@ -160,7 +157,7 @@ char **argv;
}
}
- while ((n = getline(line, sizeof (line), stdin)) > 0) {
+ while ((n = getaline(line, sizeof (line), stdin)) > 0) {
last1c = line[n-1];
if (pushrest) {
if (!wtmpf(line, n)) {
@@ -287,7 +284,7 @@ char **argv;
}
if (n == 1 && last1c == '\n') { /* blank line -- suppress */
- n = getline(buf, sizeof (buf), stdin);
+ n = getaline(buf, sizeof (buf), stdin);
if (n == 0 || (ttyf && !strncmp(buf, ".\n", 2))) {
/*
* no content: put mime-version, content-type
@@ -385,7 +382,7 @@ char **argv;
}
count += n;
n = ttyf
- ? getline(buf, sizeof (buf), stdin)
+ ? getaline(buf, sizeof (buf), stdin)
: fread(buf, 1, sizeof (buf), stdin);
}
setsig(SIGINT, saveint);
diff --git a/usr/src/cmd/mailx/collect.c b/usr/src/cmd/mailx/collect.c
index e05a586bb6..980e4f4355 100644
--- a/usr/src/cmd/mailx/collect.c
+++ b/usr/src/cmd/mailx/collect.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,15 +18,14 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1985, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
@@ -38,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* mailx -- a modified version of a University of California at Berkeley
* mail program
@@ -244,7 +240,7 @@ collect(struct header *hp)
hdrs = 0;
continue;
}
- if ((nread = getline(linebuf,LINESIZE,stdin,&hasnulls)) == NULL) {
+ if ((nread = getaline(linebuf,LINESIZE,stdin,&hasnulls)) == NULL) {
if (intty && value("ignoreeof") != NOSTR) {
if (++eof > 35)
break;
@@ -1227,7 +1223,7 @@ intack(int s)
passed must be 1 larger than "size" for the trailing NUL byte.
*/
int
-getline(char *line, int size, FILE *f, int *hasnulls)
+getaline(char *line, int size, FILE *f, int *hasnulls)
{
register int i, ch;
for (i = 0; (i < size) && ((ch=getc(f)) != EOF); ) {
diff --git a/usr/src/cmd/mailx/hdr/def.h b/usr/src/cmd/mailx/hdr/def.h
index 53a9fe9842..d0e48820ea 100644
--- a/usr/src/cmd/mailx/hdr/def.h
+++ b/usr/src/cmd/mailx/hdr/def.h
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1985, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -40,8 +39,6 @@
#ifndef _MAILX_DEF_H
#define _MAILX_DEF_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -474,7 +471,7 @@ extern int from(int *msgvec);
extern off_t fsize(FILE *iob);
extern int getfold(char *name);
extern int gethfield(register FILE *f, char linebuf[], register long rem);
-extern int getline(char *line, int size, FILE *f, int *hasnulls);
+extern int getaline(char *line, int size, FILE *f, int *hasnulls);
extern int getmessage(char *buf, int *vector, int flags);
extern int getmsglist(char *buf, int *vector, int flags);
extern int getname(uid_t uid, char namebuf[]);
diff --git a/usr/src/cmd/mailx/send.c b/usr/src/cmd/mailx/send.c
index 6979cbe522..ca2b6a3b93 100644
--- a/usr/src/cmd/mailx/send.c
+++ b/usr/src/cmd/mailx/send.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -21,8 +20,7 @@
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1985, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -38,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "rcv.h"
#include <locale.h>
@@ -96,7 +92,7 @@ msend(
lc = 0;
clearerr(obuf);
while (c > 0L) {
- nread = getline(line, LINESIZE, ibuf, &unused);
+ nread = getaline(line, LINESIZE, ibuf, &unused);
c -= nread;
lc++;
if (ishead) {
diff --git a/usr/src/cmd/mdb/common/modules/libc/libc.c b/usr/src/cmd/mdb/common/modules/libc/libc.c
index 1032977d05..da8bbc6828 100644
--- a/usr/src/cmd/mdb/common/modules/libc/libc.c
+++ b/usr/src/cmd/mdb/common/modules/libc/libc.c
@@ -845,11 +845,12 @@ d_uberdata(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
prt_addr(uberdata.ulwp_replace_last, 1),
prt_addr(uberdata.atforklist, 0));
- HD("robustlocks robustlist");
- mdb_printf(OFFSTR "%s %s\n",
+ HD("robustlocks robustlist progname");
+ mdb_printf(OFFSTR "%s %s %s\n",
OFFSET(robustlocks),
prt_addr(uberdata.robustlocks, 1),
- prt_addr(uberdata.robustlist, 0));
+ prt_addr(uberdata.robustlist, 1),
+ prt_addr(uberdata.progname, 0));
HD("tdb_bootstrap tdb_sync_addr_hash tdb_'count tdb_'fail");
mdb_printf(OFFSTR "%s %s %-10d %d\n",
diff --git a/usr/src/cmd/more/more.c b/usr/src/cmd/more/more.c
index 56bd47a6e1..523d87e7cd 100644
--- a/usr/src/cmd/more/more.c
+++ b/usr/src/cmd/more/more.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -39,8 +39,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* @(#) more.c 1.1 88/03/29 more:more.c
*/
@@ -224,7 +222,7 @@ static void set_tty(void);
static void reset_tty(void);
static void rdline(register FILE *f);
static off_t command(char *filename, register FILE *f);
-static int getline(register FILE *f, int *length);
+static int getaline(register FILE *f, int *length);
static int number(char *cmd);
static int colon(char *filename, int cmd, off_t nlines);
@@ -504,7 +502,7 @@ screen(register FILE *f, register off_t num_lines)
for (;;) {
while (num_lines > 0 && !Pause) {
- if ((nchars = getline (f, &length)) == EOF)
+ if ((nchars = getaline (f, &length)) == EOF)
{
if (clreol) clreos();
return;
@@ -726,7 +724,7 @@ wait_eof(void)
*/
static int
-getline(register FILE *f, int *length)
+getaline(register FILE *f, int *length)
{
register int c;
register char *p;
diff --git a/usr/src/cmd/ndmpd/ndmp/ndmpd_dtime.c b/usr/src/cmd/ndmpd/ndmp/ndmpd_dtime.c
index 125d9f27c0..132f88a2da 100644
--- a/usr/src/cmd/ndmpd/ndmp/ndmpd_dtime.c
+++ b/usr/src/cmd/ndmpd/ndmp/ndmpd_dtime.c
@@ -184,12 +184,12 @@ ddates_pathname(char *buf)
/*
- * getline
+ * getaline
*
* Get a line from the file and handle the continued lines.
*/
static char *
-getline(FILE *fp, char *line, int llen)
+getaline(FILE *fp, char *line, int llen)
{
char *save;
int len;
@@ -483,7 +483,7 @@ getrecord(FILE *fp, dumpdates_t *ddatep, int *recno)
return (-1);
do {
- if (getline(fp, tbuf, sizeof (tbuf)) != tbuf)
+ if (getaline(fp, tbuf, sizeof (tbuf)) != tbuf)
return (-1);
} while (!*tbuf);
diff --git a/usr/src/cmd/nscd/nscd_initf.c b/usr/src/cmd/nscd/nscd_initf.c
index 010e82b438..2a3abdc931 100644
--- a/usr/src/cmd/nscd/nscd_initf.c
+++ b/usr/src/cmd/nscd/nscd_initf.c
@@ -18,6 +18,7 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -236,10 +237,11 @@ nss_db_initf_t nscd_nss_db_initf[] = {
_nss_initf_passwd_compat,
_nss_initf_group_compat,
/*
- * no initf() for pseudo-databases: passwd, shadow, user_attr,
- * and group (when called from the compat backend)
+ * no initf() for pseudo-databases: passwd, shadow, audit_user,
+ * user_attr, and group (when called from the compat backend)
*/
NULL,
NULL,
NULL,
+ NULL,
NULL};
diff --git a/usr/src/cmd/oawk/makeprctab.c b/usr/src/cmd/oawk/makeprctab.c
index 622ac04e44..1a8c420432 100644
--- a/usr/src/cmd/oawk/makeprctab.c
+++ b/usr/src/cmd/oawk/makeprctab.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -85,7 +84,7 @@ struct xx
{ BREAK, "jump", "break"},
{ CONTINUE, "jump", "continue"},
{ FNCN, "fncn", "fncn"},
- { GETLINE, "getline", "getline"},
+ { GETLINE, "getaline", "getline"},
{ 0, ""},
};
#define SIZE LASTTOKEN - FIRSTTOKEN
diff --git a/usr/src/cmd/oawk/run.c b/usr/src/cmd/oawk/run.c
index 3f230500dc..88d666e5fa 100644
--- a/usr/src/cmd/oawk/run.c
+++ b/usr/src/cmd/oawk/run.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -156,7 +155,7 @@ program(NODE **a, int n)
CELL *
-getline(void)
+getaline(void)
{
CELL *x;
diff --git a/usr/src/cmd/pg/pg.c b/usr/src/cmd/pg/pg.c
index 22f54c6886..5408ee79c0 100644
--- a/usr/src/cmd/pg/pg.c
+++ b/usr/src/cmd/pg/pg.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -91,7 +90,7 @@ static void prompt(char *);
static void error(char *);
static void terminit();
static void compact();
-static off_t getline(FILE *);
+static off_t getaline(FILE *);
static int mrdchar();
static off_t find(int, off_t);
static int search(char *, off_t);
@@ -159,7 +158,7 @@ static wchar_t leave_search = L't';
static short nfiles;
static char *shell;
static char *promptstr = ":";
-static off_t nchars; /* return from getline in find() */
+static off_t nchars; /* return from getaline in find() */
static jmp_buf restore;
static char Line[LINSIZ+2];
@@ -1369,7 +1368,7 @@ off_t line;
else
(void) fseeko(f, (off_t)dol->l_addr, SEEK_SET);
dot = dol - 1;
- while ((nchars = getline(f)) != EOF) {
+ while ((nchars = getaline(f)) != EOF) {
dot++;
newdol(f);
if (where == dot->l_no || brk_hit)
@@ -1396,7 +1395,7 @@ off_t line;
} else {
dot = zero + where - 1;
(void) fseeko(f, (off_t)dot->l_addr, SEEK_SET);
- nchars = getline(f);
+ nchars = getaline(f);
return (dot->l_no);
}
}
@@ -1416,7 +1415,7 @@ mrdchar()
*/
static off_t
-getline(f)
+getaline(f)
FILE *f;
{
char *p;
@@ -1432,7 +1431,7 @@ FILE *f;
rdchar = (int (*)())fgetwc;
fileptr = f;
- /* copy overlap from previous call to getline */
+ /* copy overlap from previous call to getaline */
if (savlength)
(void) strncpy(Line, multic, (size_t)savlength);
for (column = 0, p = Line + savlength; ; ) {
@@ -1482,7 +1481,7 @@ FILE *f;
if (c != '\n') { /* We're stopping in the middle of the line */
if (column != columns || !auto_right_margin)
*p++ = '\n'; /* for the display */
- /* save overlap for next call to getline */
+ /* save overlap for next call to getaline */
savlength = length;
if (savlength == 0) {
/*
diff --git a/usr/src/cmd/picl/plugins/sun4u/blade/bsc/picllom.c b/usr/src/cmd/picl/plugins/sun4u/blade/bsc/picllom.c
index 3d935c1f47..462ccc1dec 100644
--- a/usr/src/cmd/picl/plugins/sun4u/blade/bsc/picllom.c
+++ b/usr/src/cmd/picl/plugins/sun4u/blade/bsc/picllom.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* This plugin creates PICL nodes and properties for objects handled through
* the blade support chip (BSC). The BSC Solaris land device driver exposes
@@ -102,7 +99,6 @@ static int read_fan_status(ptree_rarg_t *parg, void *buf);
static int lookup_led_status(int8_t state, const char **string);
static int read_led_status(ptree_rarg_t *parg, void *buf);
static void convert_node_name(char *ptr);
-static const char *strcasestr(const char *s1, const char *s2);
static int add_temp_sensors(int lom_fd, picl_nodehdl_t lominfh);
static int add_voltage_monitors(int lom_fd,
picl_nodehdl_t lominfh);
@@ -300,7 +296,7 @@ get_lom_device_path(picl_nodehdl_t *lominfh)
char devices_path[PATH_MAX];
err = ptree_get_propval_by_name(*lominfh, PICL_PROP_DEVFS_PATH,
- devfs_path, sizeof (devfs_path));
+ devfs_path, sizeof (devfs_path));
/* Build up the full device path and set the global */
strcpy(devices_path, "/devices");
@@ -854,24 +850,6 @@ convert_node_name(char *ptr)
}
}
-/*
- * find first occurrence of string s2 within string s1 (ignoring case)
- */
-static const char *
-strcasestr(const char *s1, const char *s2)
-{
- int len1 = strlen(s1);
- int len2 = strlen(s2);
- int i;
-
- for (i = 0; i <= len1 - len2; i++) {
- if (strncasecmp(s1 + i, s2, len2) == 0)
- return (s1 + i);
- }
-
- return (NULL);
-}
-
static int
add_temp_sensors(int lom_fd, picl_nodehdl_t lominfh)
{
@@ -1060,10 +1038,10 @@ add_led(const lom_led_state_t *led_state, picl_nodehdl_t lominfh)
*/
if ((led_state->colour != LOM_LED_COLOUR_NONE) &&
(led_state->colour != LOM_LED_COLOUR_ANY)) {
- err = add_regular_prop(ledh, PICL_PROP_COLOR,
- PICL_PTYPE_CHARSTRING, PICL_READ,
- colour_lkup[led_state->index].size,
- colour_lkup[led_state->index].str_colour, &proph);
+ err = add_regular_prop(ledh, PICL_PROP_COLOR,
+ PICL_PTYPE_CHARSTRING, PICL_READ,
+ colour_lkup[led_state->index].size,
+ colour_lkup[led_state->index].str_colour, &proph);
}
if (err != PICL_SUCCESS)
return;
diff --git a/usr/src/cmd/prctl/prctl.c b/usr/src/cmd/prctl/prctl.c
index 006ca6aee5..3b405d2aa7 100644
--- a/usr/src/cmd/prctl/prctl.c
+++ b/usr/src/cmd/prctl/prctl.c
@@ -18,12 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-
#include <unistd.h>
#include <rctl.h>
#include <libproc.h>
@@ -223,7 +222,7 @@ main(int argc, char **argv)
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- (void) setprogname(argv[0]);
+ (void) setpname(argv[0]);
while ((opt = getopt(argc, argv, "sPp:Fd:e:i:n:rt:v:x")) != EOF) {
diff --git a/usr/src/cmd/prctl/utils.c b/usr/src/cmd/prctl/utils.c
index fc2f29d7f9..20b84befd0 100644
--- a/usr/src/cmd/prctl/utils.c
+++ b/usr/src/cmd/prctl/utils.c
@@ -18,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/param.h>
#include <libintl.h>
#include <string.h>
@@ -44,7 +42,7 @@ static char EOL_FMT[] = "\n";
static char *pname;
char *
-setprogname(char *arg0)
+setpname(char *arg0)
{
char *p = strrchr(arg0, '/');
diff --git a/usr/src/cmd/prctl/utils.h b/usr/src/cmd/prctl/utils.h
index 1afa19fe90..2cc1452dd3 100644
--- a/usr/src/cmd/prctl/utils.h
+++ b/usr/src/cmd/prctl/utils.h
@@ -18,16 +18,14 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _UTILS_H
#define _UTILS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -35,7 +33,7 @@ extern "C" {
#include <sys/types.h>
extern void warn(const char *, ...);
-extern char *setprogname(char *);
+extern char *setpname(char *);
/*
* scale_t
diff --git a/usr/src/cmd/prtconf/prtconf.c b/usr/src/cmd/prtconf/prtconf.c
index 8a4a97d29f..8b6c8f3a9a 100644
--- a/usr/src/cmd/prtconf/prtconf.c
+++ b/usr/src/cmd/prtconf/prtconf.c
@@ -18,6 +18,7 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -25,7 +26,6 @@
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -50,7 +50,7 @@ static const char *usage =
#endif /* __x86 */
static void
-setprogname(const char *name)
+setpname(const char *name)
{
char *p;
@@ -178,7 +178,7 @@ main(int argc, char *argv[])
int c, ret;
char hw_provider[SYS_NMLN];
- setprogname(argv[0]);
+ setpname(argv[0]);
opts.o_promdev = "/dev/openprom";
while ((c = getopt(argc, argv, optstring)) != -1) {
diff --git a/usr/src/cmd/prtdiag/main.c b/usr/src/cmd/prtdiag/main.c
index 6a666c8c7c..8807cde8d9 100644
--- a/usr/src/cmd/prtdiag/main.c
+++ b/usr/src/cmd/prtdiag/main.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -21,8 +20,7 @@
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -30,8 +28,6 @@
* All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
@@ -43,7 +39,7 @@
extern int do_prominfo(int, char *, int, int);
static char *
-setprogname(char *name)
+setpname(char *name)
{
char *p;
@@ -58,7 +54,7 @@ main(int argc, char *argv[])
{
int c;
int syserrlog = 0;
- char *progname = setprogname(argv[0]);
+ char *progname = setpname(argv[0]);
int print_flag = 1;
int logging = 0;
diff --git a/usr/src/cmd/rcap/common/utils.c b/usr/src/cmd/rcap/common/utils.c
index b641a13a13..799fdcef23 100644
--- a/usr/src/cmd/rcap/common/utils.c
+++ b/usr/src/cmd/rcap/common/utils.c
@@ -18,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/param.h>
#include <libintl.h>
#include <stdarg.h>
@@ -154,7 +152,7 @@ info(char *format, ...)
}
char *
-setprogname(char *arg0)
+setpname(char *arg0)
{
char *p = strrchr(arg0, '/');
diff --git a/usr/src/cmd/rcap/common/utils.h b/usr/src/cmd/rcap/common/utils.h
index 4c78d11ff0..7196cfb4ce 100644
--- a/usr/src/cmd/rcap/common/utils.h
+++ b/usr/src/cmd/rcap/common/utils.h
@@ -18,16 +18,14 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _UTILS_H
#define _UTILS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <assert.h>
#include <libintl.h>
#include <stdarg.h>
@@ -93,7 +91,7 @@ extern void info(char *, ...);
extern rcm_level_t get_message_priority(void);
extern rcm_level_t set_message_priority(rcm_level_t);
extern rcm_dst_t set_message_destination(rcm_dst_t);
-extern char *setprogname(char *);
+extern char *setpname(char *);
extern void warn(const char *, ...);
extern int valid_abspath(char *);
extern void vdprintfe(int, const char *, va_list);
diff --git a/usr/src/cmd/rcap/rcapadm/rcapadm.c b/usr/src/cmd/rcap/rcapadm/rcapadm.c
index f8e6269221..92888b2071 100644
--- a/usr/src/cmd/rcap/rcapadm/rcapadm.c
+++ b/usr/src/cmd/rcap/rcapadm/rcapadm.c
@@ -18,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -129,7 +127,7 @@ out:
else
(void) printf(gettext(" "
"state: %s\n"), *persistent ? gettext("enabled") :
- gettext("disabled"));
+ gettext("disabled"));
(void) printf(gettext(" memory cap enforcement"
" threshold: %d%%\n"), conf.rcfg_memory_cap_enforcement_pressure);
@@ -190,7 +188,7 @@ main(int argc, char *argv[])
char *zonename;
char *maxrss = NULL;
- (void) setprogname("rcapadm");
+ (void) setpname("rcapadm");
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
diff --git a/usr/src/cmd/rcap/rcapd/rcapd_main.c b/usr/src/cmd/rcap/rcapd/rcapd_main.c
index bb0a13f129..d18b2c9e04 100644
--- a/usr/src/cmd/rcap/rcapd/rcapd_main.c
+++ b/usr/src/cmd/rcap/rcapd/rcapd_main.c
@@ -18,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* rcapd is a long-running daemon enforcing project-based resource caps (see
* rcapd(1M)). Each instance of a process aggregate (project or, generically,
@@ -1217,7 +1215,7 @@ update_statistics(void)
if (fchmod(fd, 0644) == 0 && write(fd, &rs, sizeof (rs)) ==
sizeof (rs)) {
list_walk_collection(report_collection_cb,
- (void *)(intptr_t)fd);
+ (void *)(intptr_t)fd);
/*
* Replace the existing statistics file with this new
* one.
@@ -1447,7 +1445,7 @@ main(int argc, char *argv[])
hrtime_t next_rss_sample; /* (latest) time of next RSS sample */
(void) set_message_priority(RCM_INFO);
- (void) setprogname("rcapd");
+ (void) setpname("rcapd");
rcapd_pid = getpid();
(void) chdir("/");
should_run = 1;
diff --git a/usr/src/cmd/rcap/rcapstat/rcapstat.c b/usr/src/cmd/rcap/rcapstat/rcapstat.c
index edac6dd56d..fb83f861ae 100644
--- a/usr/src/cmd/rcap/rcapstat/rcapstat.c
+++ b/usr/src/cmd/rcap/rcapstat/rcapstat.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/types.h>
@@ -365,7 +365,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- (void) setprogname("rcapstat");
+ (void) setpname("rcapstat");
global = unformatted = 0;
while ((opt = getopt(argc, argv, "gpuzT:")) != (int)EOF) {
diff --git a/usr/src/cmd/rctladm/rctladm.c b/usr/src/cmd/rctladm/rctladm.c
index 1748970a8b..c60cb9471b 100644
--- a/usr/src/cmd/rctladm/rctladm.c
+++ b/usr/src/cmd/rctladm/rctladm.c
@@ -18,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/rctl_impl.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -452,7 +450,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- (void) setprogname(argv[0]);
+ (void) setpname(argv[0]);
while ((c = getopt(argc, argv, OPTS)) != EOF) {
switch (c) {
diff --git a/usr/src/cmd/rctladm/utils.c b/usr/src/cmd/rctladm/utils.c
index 0b3f727622..1a7d5227a2 100644
--- a/usr/src/cmd/rctladm/utils.c
+++ b/usr/src/cmd/rctladm/utils.c
@@ -18,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/param.h>
#include <libintl.h>
#include <string.h>
@@ -73,7 +71,7 @@ die(char *format, ...)
}
char *
-setprogname(char *arg0)
+setpname(char *arg0)
{
char *p = strrchr(arg0, '/');
diff --git a/usr/src/cmd/rctladm/utils.h b/usr/src/cmd/rctladm/utils.h
index 2d5ccd8abe..ae0dff31e0 100644
--- a/usr/src/cmd/rctladm/utils.h
+++ b/usr/src/cmd/rctladm/utils.h
@@ -18,16 +18,14 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _UTILS_H
#define _UTILS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -44,7 +42,7 @@ extern "C" {
extern void warn(const char *, ...);
extern void die(char *, ...) __NORETURN;
-extern char *setprogname(char *);
+extern char *setpname(char *);
#ifdef __cplusplus
}
diff --git a/usr/src/cmd/sendmail/db/clib/strsep.c b/usr/src/cmd/sendmail/db/clib/strsep.c
index 093a1c9328..02f8dae826 100644
--- a/usr/src/cmd/sendmail/db/clib/strsep.c
+++ b/usr/src/cmd/sendmail/db/clib/strsep.c
@@ -36,18 +36,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+
/*
- * Copyright (c) 1998 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include "config.h"
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifndef lint
static const char sccsid[] = "@(#)strsep.c 10.1 (Sleepycat) 4/12/97";
-static const char sccsi2[] = "%W% (Sun) %G%";
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
@@ -70,6 +67,9 @@ static const char sccsi2[] = "%W% (Sun) %G%";
* PUBLIC: char *strsep __P((char **, const char *));
* PUBLIC: #endif
*/
+
+#ifndef HAVE_STRSEP
+
char *
strsep(stringp, delim)
register char **stringp;
@@ -98,3 +98,5 @@ strsep(stringp, delim)
}
/* NOTREACHED */
}
+
+#endif /* HAVE_STRSEP */
diff --git a/usr/src/cmd/sgs/crle/common/print.c b/usr/src/cmd/sgs/crle/common/print.c
index 9399495bd5..2692018dfc 100644
--- a/usr/src/cmd/sgs/crle/common/print.c
+++ b/usr/src/cmd/sgs/crle/common/print.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/types.h>
@@ -33,7 +32,6 @@
#include <unistd.h>
#include <errno.h>
#include <limits.h>
-#include <alloca.h>
#include "sgs.h"
#include "rtc.h"
#include "conv.h"
@@ -346,7 +344,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
/*
* Construct the original command line argument.
*/
- cmd = strcpy(alloca(MSG_CMD_64_SIZE + 1), MSG_ORIG(MSG_CMD_64));
+ cmd = strdupa(MSG_ORIG(MSG_CMD_64));
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
}
@@ -383,7 +381,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
*/
(void) snprintf(_cmd, PATH_MAX, MSG_ORIG(MSG_CMD_CONF),
crle->c_confil);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
@@ -395,7 +393,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
(void) snprintf(_cmd, PATH_MAX, MSG_ORIG(MSG_CMD_FLAGS),
conv_dl_flag(head->ch_dlflags, CONV_FMT_ALT_CRLE,
&dl_flag_buf));
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
}
@@ -443,13 +441,13 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
*/
(void) snprintf(_cmd, PATH_MAX,
MSG_ORIG(MSG_CMD_OUTPUT), crle->c_objdir);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
(void) snprintf(_cmd, PATH_MAX,
MSG_ORIG(MSG_CMD_DUMPGRP), (strtbl + obj->co_name));
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
}
@@ -488,7 +486,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
(void) snprintf(_cmd, PATH_MAX,
MSG_ORIG(MSG_CMD_EDLIB), str);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
}
@@ -555,7 +553,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
(void) snprintf(_cmd, PATH_MAX,
MSG_ORIG(MSG_CMD_ESLIB), str);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
}
@@ -607,7 +605,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
(void) snprintf(_cmd, PATH_MAX,
MSG_ORIG(MSG_CMD_ADLIB), str);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
}
@@ -647,7 +645,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
(void) snprintf(_cmd, PATH_MAX,
MSG_ORIG(MSG_CMD_ASLIB), str);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd, AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
}
@@ -707,7 +705,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
}
(void) printf(pfmt, str);
(void) snprintf(_cmd, PATH_MAX, sfmt, str);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd,
AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
@@ -808,7 +806,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
/* LINTED */
(void) snprintf(_cmd, PATH_MAX,
getformat(dobj->co_flags), str);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd,
AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
@@ -901,8 +899,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
(void) snprintf(_cmd, PATH_MAX,
MSG_ORIG(MSG_CMD_OUTPUT),
crle->c_objdir);
- cmd = strcpy(alloca(strlen(_cmd) + 1),
- _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd,
AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
@@ -911,7 +908,7 @@ scanconfig(Crle_desc * crle, Addr addr, int c_class)
/* LINTED */
(void) snprintf(_cmd, PATH_MAX,
getformat(flags), str);
- cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
+ cmd = strdupa(_cmd);
if (aplist_append(&cmdline, cmd,
AL_CNT_CRLE) == NULL)
return (INSCFG_RET_FAIL);
diff --git a/usr/src/cmd/sgs/libconv/common/demangle.c b/usr/src/cmd/sgs/libconv/common/demangle.c
index aa3589a51c..8b590d87e0 100644
--- a/usr/src/cmd/sgs/libconv/common/demangle.c
+++ b/usr/src/cmd/sgs/libconv/common/demangle.c
@@ -20,10 +20,8 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <demangle.h>
@@ -50,8 +48,7 @@
* buffer). One model is:
*
* if ((_name1 = demangle(name1)) != name1) {
- * char * __name1 = alloca(strlen(_name1) + 1);
- * (void) strcpy(__name1, _name1);
+ * char * __name1 = strdupa(_name1);
* name1 = (const char *)__name1;
* }
* name2 = demangle(name2);
diff --git a/usr/src/cmd/sgs/lorder/lorder.sh b/usr/src/cmd/sgs/lorder/lorder.sh
index 81ba58df7b..4b518e3d61 100644
--- a/usr/src/cmd/sgs/lorder/lorder.sh
+++ b/usr/src/cmd/sgs/lorder/lorder.sh
@@ -3,9 +3,8 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -22,12 +21,9 @@
#
# Copyright (c) 1989 AT&T
# All Rights Reserved
-
-
-# Copyright 1998-2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+#
+# Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
+#
# COMMON LORDER
#
@@ -91,7 +87,7 @@ esac
#
${WHERE}/${PFX}nm -p $* 2>$TDIR/$$tmp | sed -e '/^[ ]*$/d' -e '
/^[0-9]* R $/d
- / [a-zFS] /d
+ / [a-zFLS] /d
/[^]]:$/{
s/://
h
diff --git a/usr/src/cmd/sgs/rtld/common/external.c b/usr/src/cmd/sgs/rtld/common/external.c
index 91b4227f16..82766906b5 100644
--- a/usr/src/cmd/sgs/rtld/common/external.c
+++ b/usr/src/cmd/sgs/rtld/common/external.c
@@ -582,6 +582,26 @@ thr_min_stack()
}
/*
+ * Local str[n]casecmp() interfaces for the dynamic linker,
+ * to avoid problems when linking with libc_pic.a
+ */
+int
+strcasecmp(const char *s1, const char *s2)
+{
+ extern int ascii_strcasecmp(const char *, const char *);
+
+ return (ascii_strcasecmp(s1, s2));
+}
+
+int
+strncasecmp(const char *s1, const char *s2, size_t n)
+{
+ extern int ascii_strncasecmp(const char *, const char *, size_t);
+
+ return (ascii_strncasecmp(s1, s2, n));
+}
+
+/*
* The following functions are cancellation points in libc.
* They are called from other functions in libc that we extract
* and use directly. We don't do cancellation while we are in
diff --git a/usr/src/cmd/ssh/include/config.h b/usr/src/cmd/ssh/include/config.h
index c718d259ad..884e177d9b 100644
--- a/usr/src/cmd/ssh/include/config.h
+++ b/usr/src/cmd/ssh/include/config.h
@@ -1,9 +1,9 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* $Id: acconfig.h,v 1.145 2002/09/26 00:38:48 tim Exp $ */
+
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _CONFIG_H
@@ -214,7 +214,7 @@ extern "C" {
/* #undef USE_EXTERNAL_ASKPASS */
/* Define if libc defines __progname */
-/* #undef HAVE___PROGNAME */
+#define HAVE___PROGNAME 1
/* Define if compiler implements __FUNCTION__ */
#define HAVE___FUNCTION__ 1
diff --git a/usr/src/cmd/svr4pkg/libinst/dockdeps.c b/usr/src/cmd/svr4pkg/libinst/dockdeps.c
index 195a680727..ec7da35dd7 100644
--- a/usr/src/cmd/svr4pkg/libinst/dockdeps.c
+++ b/usr/src/cmd/svr4pkg/libinst/dockdeps.c
@@ -20,15 +20,12 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
-
#include <stdio.h>
#include <errno.h>
#include <limits.h>
@@ -92,7 +89,7 @@ static void prereq(char *pkginst, char *pkgname,
boolean_t a_preinstallCheck);
static void incompat(char *pkginst, char *pkgname,
boolean_t a_preinstallCheck);
-static int getline(FILE *fp);
+static int getaline(FILE *fp);
/*
* *****************************************************************************
@@ -124,7 +121,7 @@ dockdeps(char *a_depfile, int a_removeFlag, boolean_t a_preinstallCheck)
}
}
- while (getline(fp)) {
+ while (getaline(fp)) {
switch (type) {
case 'I':
case 'P':
@@ -323,7 +320,7 @@ deponme(char *pkginst, char *pkgname, boolean_t a_preinstallCheck)
}
static int
-getline(FILE *fp)
+getaline(FILE *fp)
{
register int i, c, found;
char *pt, *new, line[LSIZE];
@@ -422,7 +419,7 @@ ckpreq(FILE *fp, char *dname, boolean_t a_preinstallCheck)
register int i;
char *inst;
- while (getline(fp)) {
+ while (getaline(fp)) {
if (type != 'P')
continue;
diff --git a/usr/src/cmd/vi/misc/ctags.c b/usr/src/cmd/vi/misc/ctags.c
index 910257d04a..d6e2de739b 100644
--- a/usr/src/cmd/vi/misc/ctags.c
+++ b/usr/src/cmd/vi/misc/ctags.c
@@ -1,6 +1,5 @@
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1988 AT&T */
@@ -43,9 +42,6 @@ char copyright[] = "@(#) Copyright (c) 1980 Regents of the University of "
"California.\nAll rights reserved.\n";
#endif
-#pragma ident "%Z%%M% %I% %E% SMI"
- /* from UCB 5.1 5/31/85 */
-
#include <stdio.h>
#include <ctype.h>
#include <locale.h>
@@ -172,7 +168,7 @@ static void C_entries();
static int start_entry(char **lp, char *token, int *f);
static void Y_entries();
static char *toss_comment(char *start);
-static void getline(long int where);
+static void getaline(long int where);
static void free_tree(NODE *node);
static void add_node(NODE *node, NODE *cur_node);
static void put_entries(NODE *node);
@@ -371,7 +367,7 @@ char *file;
* throw away all the code before the second "%%"
*/
toss_yysec();
- getline(lineftell);
+ getaline(lineftell);
pfnote("yylex", lineno, TRUE);
toss_yysec();
C_entries();
@@ -684,7 +680,7 @@ dotoken:
if (start_entry(&sp, token, &f)) {
(void) strncpy(tok, token, tp-token+1);
tok[tp-token+1] = 0;
- getline(tokftell);
+ getaline(tokftell);
pfnote(tok, pfline, f);
gotone = f; /* function */
}
@@ -844,7 +840,7 @@ Y_entries()
char tok[BUFSIZ];
brace = 0;
- getline(lineftell);
+ getaline(lineftell);
pfnote("yyparse", lineno, TRUE);
while (fgets(line, sizeof (line), inf) != NULL)
for (sp = line; *sp; sp++)
@@ -951,7 +947,7 @@ char *start;
}
static void
-getline(where)
+getaline(where)
long int where;
{
long saveftell = ftell(inf);
diff --git a/usr/src/cmd/vi/port/ex.h b/usr/src/cmd/vi/port/ex.h
index 4f6ee98a04..820937be46 100644
--- a/usr/src/cmd/vi/port/ex.h
+++ b/usr/src/cmd/vi/port/ex.h
@@ -18,22 +18,19 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
/* Copyright (c) 1981 Regents of the University of California */
#ifndef _EX_H
#define _EX_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -604,7 +601,7 @@ void vroll(int);
void vrollR(int);
void vnline(unsigned char *);
void noerror();
-void getline(line);
+void getaline(line);
void viprintf();
void gettmode(void);
void setterm(unsigned char *);
diff --git a/usr/src/cmd/vi/port/ex_cmds.c b/usr/src/cmd/vi/port/ex_cmds.c
index 3ca2af395a..ab7146ce0f 100644
--- a/usr/src/cmd/vi/port/ex_cmds.c
+++ b/usr/src/cmd/vi/port/ex_cmds.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -29,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_argv.h"
#include "ex_temp.h"
@@ -1005,7 +1003,7 @@ caseline:
nonzero();
if (seensemi)
addr1 = addr2;
- getline(*addr1);
+ getaline(*addr1);
if (c == CTRL('k')) {
flush1();
destline--;
diff --git a/usr/src/cmd/vi/port/ex_cmdsub.c b/usr/src/cmd/vi/port/ex_cmdsub.c
index 7a121a6e12..4e7e4b0005 100644
--- a/usr/src/cmd/vi/port/ex_cmdsub.c
+++ b/usr/src/cmd/vi/port/ex_cmdsub.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_argv.h"
#include "ex_temp.h"
@@ -253,7 +250,7 @@ join(int c)
cp = genbuf;
*cp = 0;
for (a1 = addr1; a1 <= addr2; a1++) {
- getline(*a1);
+ getaline(*a1);
cp1 = linebuf;
if (a1 != addr1 && c == 0) {
while (*cp1 == ' ' || *cp1 == '\t')
@@ -410,7 +407,7 @@ getcopy(void)
if (tad1 > addr2)
return (EOF);
- getline(*tad1++);
+ getaline(*tad1++);
return (0);
}
@@ -423,7 +420,7 @@ getput(void)
if (tad1 > unddol)
return (EOF);
- getline(*tad1++);
+ getaline(*tad1++);
tad1++;
return (0);
}
@@ -490,7 +487,7 @@ pragged(bool kill)
* Get last line of undo area ("3") into linebuf.
*/
- getline(*unddol);
+ getaline(*unddol);
if (kill)
*pkill[1] = 0;
@@ -518,7 +515,7 @@ pragged(bool kill)
* So linebuf = "1"
*/
- getline(dol[1]);
+ getaline(dol[1]);
if (kill)
strcLIN(pkill[0]);
@@ -1129,7 +1126,7 @@ zop2(int nlines, int op)
if (addr1 > addr2)
return;
if (op == EOF && zhadpr) {
- getline(*addr1);
+ getaline(*addr1);
putchar((int)('\r' | QUOTE));
shudclob = 1;
} else if (znoclear == 0 && clear_screen != NOSTR && !inopen) {
@@ -1165,7 +1162,7 @@ plines(line *adr1, line *adr2, bool movedot)
pofix();
for (addr = adr1; addr <= adr2; addr++) {
- getline(*addr);
+ getaline(*addr);
pline(lineno(addr));
if (inopen)
putchar((int)('\n' | QUOTE));
diff --git a/usr/src/cmd/vi/port/ex_get.c b/usr/src/cmd/vi/port/ex_get.c
index 129aa91031..95be2c3d20 100644
--- a/usr/src/cmd/vi/port/ex_get.c
+++ b/usr/src/cmd/vi/port/ex_get.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_tty.h"
@@ -300,5 +297,5 @@ setin(line *addr)
if (addr == zero)
lastin = 0;
else
- getline(*addr), lastin = smunch(0, linebuf);
+ getaline(*addr), lastin = smunch(0, linebuf);
}
diff --git a/usr/src/cmd/vi/port/ex_io.c b/usr/src/cmd/vi/port/ex_io.c
index 0a569bd894..e63fab87ae 100644
--- a/usr/src/cmd/vi/port/ex_io.c
+++ b/usr/src/cmd/vi/port/ex_io.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_argv.h"
#include "ex_temp.h"
@@ -480,7 +477,7 @@ rop2(void)
for (a=first; a<=last; a++) {
if (a==first+5 && last-first > 10)
a = last - 4;
- getline(*a);
+ getaline(*a);
chkmdln(linebuf);
}
}
@@ -767,7 +764,7 @@ putfile(int isfilter)
nib = BUFSIZE;
fp = genbuf;
do {
- getline(*a1++);
+ getaline(*a1++);
lp = linebuf;
for (;;) {
if (--nib < 0) {
diff --git a/usr/src/cmd/vi/port/ex_re.c b/usr/src/cmd/vi/port/ex_re.c
index ac58cf65d4..3d3f1a036a 100644
--- a/usr/src/cmd/vi/port/ex_re.c
+++ b/usr/src/cmd/vi/port/ex_re.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_re.h"
@@ -1107,7 +1104,7 @@ execute(int gf, line *addr)
if (addr == zero)
return (0);
p1 = linebuf;
- getline(*addr);
+ getaline(*addr);
if(value(vi_IGNORECASE)) {
p1 = genbuf;
p2 = linebuf;
diff --git a/usr/src/cmd/vi/port/ex_set.c b/usr/src/cmd/vi/port/ex_set.c
index 2308ae588c..fb2de4cb5f 100644
--- a/usr/src/cmd/vi/port/ex_set.c
+++ b/usr/src/cmd/vi/port/ex_set.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_temp.h"
#include "ex_tty.h"
@@ -189,7 +186,7 @@ set(void)
viprintf("%d\n", tmpadr);
else {
viprintf("%d\t", tmpadr);
- getline(*tmpadr);
+ getaline(*tmpadr);
pline(lineno(tmpadr));
putchar('\n');
}
@@ -231,7 +228,7 @@ set(void)
viprintf("%d\n", tmpadr);
else {
viprintf("%d\t", tmpadr);
- getline(*tmpadr);
+ getaline(*tmpadr);
pline(lineno(tmpadr));
putchar('\n');
}
diff --git a/usr/src/cmd/vi/port/ex_subr.c b/usr/src/cmd/vi/port/ex_subr.c
index d5193dbe26..ea3f4b3929 100644
--- a/usr/src/cmd/vi/port/ex_subr.c
+++ b/usr/src/cmd/vi/port/ex_subr.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/stropts.h>
#include <sys/eucioctl.h>
#ifndef PRESUNEUC
@@ -219,7 +216,7 @@ void
getDOT(void)
{
- getline(*dot);
+ getaline(*dot);
}
line *
diff --git a/usr/src/cmd/vi/port/ex_temp.c b/usr/src/cmd/vi/port/ex_temp.c
index c7040ff575..fd061b83e3 100644
--- a/usr/src/cmd/vi/port/ex_temp.c
+++ b/usr/src/cmd/vi/port/ex_temp.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_temp.h"
#include "ex_vis.h"
@@ -157,7 +154,7 @@ cleanup(bool all)
}
void
-getline(line tl)
+getaline(line tl)
{
unsigned char *bp, *lp;
int nl;
@@ -688,7 +685,7 @@ YANKreg(int c)
}
CP(savelb, linebuf);
for (addr = addr1; addr <= addr2; addr++) {
- getline(*addr);
+ getaline(*addr);
if (sp->rg_flags) {
if (addr == addr2)
*wcursor = 0;
diff --git a/usr/src/cmd/vi/port/ex_vadj.c b/usr/src/cmd/vi/port/ex_vadj.c
index 3be4add496..3eb419abb6 100644
--- a/usr/src/cmd/vi/port/ex_vadj.c
+++ b/usr/src/cmd/vi/port/ex_vadj.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_tune.h"
#include "ex_tty.h"
@@ -90,7 +87,7 @@ vopen(line *tp, int p)
* and so it's not worth optimizing.
*/
vdirty(vcline+1, WECHO);
- getline(*tp);
+ getaline(*tp);
/*
* If we are opening at the top of the window, can try a window
@@ -685,7 +682,7 @@ vredraw(int p)
if (l == vcline)
strcLIN(temp);
else
- getline(*tp);
+ getaline(*tp);
/*
* Delete junk between displayed lines.
@@ -729,7 +726,7 @@ vredraw(int p)
vcline = l;
for (; tp <= dol && Peekkey != ATTN; tp++) {
- getline(*tp);
+ getaline(*tp);
if (p + vdepth() - 1 > WBOT)
break;
vopen(tp, p);
@@ -897,7 +894,7 @@ vsync1(int p)
if (l == vcline)
strcLIN(temp);
else
- getline(dot[l - vcline]);
+ getaline(dot[l - vcline]);
/*
* Be careful that a long line doesn't cause the
* screen to shoot up.
diff --git a/usr/src/cmd/vi/port/ex_vget.c b/usr/src/cmd/vi/port/ex_vget.c
index b0b0260331..c96d4bc29c 100644
--- a/usr/src/cmd/vi/port/ex_vget.c
+++ b/usr/src/cmd/vi/port/ex_vget.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
@@ -755,7 +752,7 @@ unsigned char *s;
fprintf(trace, "linebuf = '%s'\n", linebuf);
for (p=zero+1; p<=truedol; p++) {
fprintf(trace, "%o ", *p);
- getline(*p);
+ getaline(*p);
fprintf(trace, "'%s'\n", linebuf);
}
fprintf(trace, "]\n");
diff --git a/usr/src/cmd/vi/port/ex_voper.c b/usr/src/cmd/vi/port/ex_voper.c
index 825996d0c4..8ce2904af2 100644
--- a/usr/src/cmd/vi/port/ex_voper.c
+++ b/usr/src/cmd/vi/port/ex_voper.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -747,7 +747,7 @@ errlab:
markDOT();
if (wcursor) {
vsave();
- getline(*wdot);
+ getaline(*wdot);
if (wcursor > strend(linebuf))
wcursor = 0;
else {
diff --git a/usr/src/cmd/vi/port/ex_vops.c b/usr/src/cmd/vi/port/ex_vops.c
index 104bcd3988..71dba8cf5a 100644
--- a/usr/src/cmd/vi/port/ex_vops.c
+++ b/usr/src/cmd/vi/port/ex_vops.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -29,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
@@ -526,7 +524,7 @@ vchange(unsigned char c)
*/
*cursor = 0;
strcpy(genbuf, linebuf);
- getline(*wdot);
+ getaline(*wdot);
if (strlen(genbuf) + strlen(wcursor) > LBSIZE - 2) {
getDOT();
(void) beep();
@@ -910,7 +908,7 @@ xdw(void)
if (vpastwh(linebuf) >= cursor)
wcursor = 0;
else {
- getline(*wdot);
+ getaline(*wdot);
wcursor = strend(linebuf);
getDOT();
}
diff --git a/usr/src/cmd/vi/port/ex_vops2.c b/usr/src/cmd/vi/port/ex_vops2.c
index 2ef2d8aec1..f47b9adcdf 100644
--- a/usr/src/cmd/vi/port/ex_vops2.c
+++ b/usr/src/cmd/vi/port/ex_vops2.c
@@ -18,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -29,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
@@ -781,7 +779,7 @@ imultlinerep(int savecnt, line *startsrcline, int startsrccol, int endsrccol)
* of the repeated insert, then copy this line to the temp file.
*/
(void) strlcpy((char *)genbuf, (char *)linebuf, sizeof (genbuf));
- getline(*startsrcline);
+ getaline(*startsrcline);
if (strlcpy((char *)(genbuf + endsrccol + 1),
(char *)(linebuf + startsrccol), destsize) >= destsize) {
error(gettext("Line too long"));
@@ -808,7 +806,7 @@ imultlinerep(int savecnt, line *startsrcline, int startsrccol, int endsrccol)
getDOT();
cursor = linebuf + endsrccol;
} else {
- getline(*srcline);
+ getaline(*srcline);
/* copy linebuf to temp file */
vdoappend(linebuf);
vcline++;
@@ -840,7 +838,7 @@ omultlinerep(int savecnt, line *startsrcline, int endsrccol)
*/
while (tmpcnt <= savecnt) {
for (srcline = startsrcline; srcline <= endsrcline; ++srcline) {
- getline(*srcline);
+ getaline(*srcline);
/* copy linebuf to temp file */
vdoappend(linebuf);
vcline++;
diff --git a/usr/src/cmd/vi/port/ex_vops3.c b/usr/src/cmd/vi/port/ex_vops3.c
index d90a4d3c3c..733903ca9f 100644
--- a/usr/src/cmd/vi/port/ex_vops3.c
+++ b/usr/src/cmd/vi/port/ex_vops3.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
@@ -331,7 +328,7 @@ again:
int cnt = 0;
addr--;
- getline(*addr);
+ getaline(*addr);
for (cp = linebuf; *cp; cp++)
if (*cp == '(')
cnt++;
@@ -548,7 +545,7 @@ lnext(void)
return (0);
}
wdot++;
- getline(*wdot);
+ getaline(*wdot);
wcursor = linebuf;
return (1);
} else {
@@ -562,7 +559,7 @@ lnext(void)
return (0);
}
wdot--;
- getline(*wdot);
+ getaline(*wdot);
if(!*linebuf)
wcursor = linebuf;
else {
@@ -585,7 +582,7 @@ lbrack(int c, int (*f)())
addr -= dir;
break;
}
- getline(*addr);
+ getaline(*addr);
if (linebuf[0] == '{' ||
#ifdef XPG4
/* POSIX 1003.2 Section 5.35.7.1: control-L */
@@ -595,7 +592,7 @@ lbrack(int c, int (*f)())
isa(svalue(vi_SECTIONS))) {
if (c == ']' && f != vmove) {
addr--;
- getline(*addr);
+ getaline(*addr);
}
break;
}
diff --git a/usr/src/cmd/vi/port/ex_vwind.c b/usr/src/cmd/vi/port/ex_vwind.c
index 6b74f723bc..cdaf577a2b 100644
--- a/usr/src/cmd/vi/port/ex_vwind.c
+++ b/usr/src/cmd/vi/port/ex_vwind.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,9 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -30,8 +29,6 @@
/* Copyright (c) 1981 Regents of the University of California */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ex.h"
#include "ex_tty.h"
#include "ex_vis.h"
@@ -201,24 +198,24 @@ vcontext(line *addr, unsigned char where)
{
line *top;
- getline(*addr);
+ getaline(*addr);
if (state != VISUAL)
top = addr;
else switch (where) {
case '^':
addr = vback(addr, basWLINES - vdepth());
- getline(*addr);
+ getaline(*addr);
/* fall into ... */
case '-':
top = vback(addr, basWLINES - vdepth());
- getline(*addr);
+ getaline(*addr);
break;
case '.':
top = vback(addr, basWLINES / 2 - vdepth());
- getline(*addr);
+ getaline(*addr);
break;
default:
@@ -334,7 +331,7 @@ vback(tp, cnt)
if (cnt > 0)
for (; tp > one; tp--) {
- getline(tp[-1]);
+ getaline(tp[-1]);
d = vdepth();
if (d > cnt)
break;
@@ -354,7 +351,7 @@ vfit(line *tp, int cnt)
j = 0;
while (cnt > 0) {
cnt--;
- getline(tp[cnt]);
+ getaline(tp[cnt]);
j += vdepth();
}
if (tp > dot)
diff --git a/usr/src/cmd/vi/port/exrecover.c b/usr/src/cmd/vi/port/exrecover.c
index 044e1ce2e5..a09ea0611a 100644
--- a/usr/src/cmd/vi/port/exrecover.c
+++ b/usr/src/cmd/vi/port/exrecover.c
@@ -18,10 +18,10 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
-*/
+ * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
@@ -707,7 +707,7 @@ rputfile(void)
#ifdef DEBUG
fprintf(stderr,"GETTING A LINE \n");
#endif
- getline(*a1++);
+ getaline(*a1++);
lp = linebuf;
#ifdef DEBUG
fprintf(stderr,"LINE:%s\n",linebuf);
@@ -755,7 +755,7 @@ clrstats(void)
#define WRITE 1
void
-getline(line tl)
+getaline(line tl)
{
unsigned char *bp, *lp;
int nl;
diff --git a/usr/src/cmd/ypcmd/mknetid/getname.c b/usr/src/cmd/ypcmd/mknetid/getname.c
index 5f60fd801e..36d3198939 100644
--- a/usr/src/cmd/ypcmd/mknetid/getname.c
+++ b/usr/src/cmd/ypcmd/mknetid/getname.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,14 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI" /* SMI4.1 1.3 */
-
#include <stdio.h>
#include <string.h>
@@ -35,12 +31,12 @@
#define isignore(c) (strchr(ignore, c) != NULL)
/*
- * getline()
+ * getaline()
* Read a line from a file.
* What's returned is a cookie to be passed to getname
*/
char **
-getline(line, maxlinelen, f, lcount, com)
+getaline(line, maxlinelen, f, lcount, com)
char *line;
int maxlinelen;
FILE *f;
diff --git a/usr/src/cmd/ypcmd/mknetid/mknetid.c b/usr/src/cmd/ypcmd/mknetid/mknetid.c
index 23434ccbfa..85a1661b81 100644
--- a/usr/src/cmd/ypcmd/mknetid/mknetid.c
+++ b/usr/src/cmd/ypcmd/mknetid/mknetid.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,14 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI" /* SMI4.1 1.5 */
-
/*
* Network name to unix credential database generator.
* Uses /etc/passwd, /etc/group, /etc/hosts and /etc/netid to
@@ -57,7 +53,7 @@
#define NUMGIDS (NGROUPS_MAX + 1) /* group-access-list + gid */
-extern char **getline();
+extern char **getaline();
extern char *malloc();
extern char *strcpy();
@@ -172,7 +168,7 @@ domapfile(mapfile, mf)
curfile = mapfile;
curline = 0;
- while (lp = getline(line, sizeof (line), mf, &curline, "#")) {
+ while (lp = getaline(line, sizeof (line), mf, &curline, "#")) {
check_getname(lp, name, WHITE, WHITE, "#");
if (wasprinted(name)) {
multdef(name);
@@ -219,7 +215,7 @@ dogrpfile(grpfile, gf)
curfile = grpfile;
curline = 0;
- while (lp = getline(line, sizeof (line), gf, &curline, "")) {
+ while (lp = getaline(line, sizeof (line), gf, &curline, "")) {
check_getname(lp, name, WHITE, COLON, "");
if (name[0] == '+') {
continue;
@@ -252,7 +248,7 @@ dopwdfile(pwdfile, pf)
curfile = pwdfile;
curline = 0;
- while (lp = getline(line, sizeof (line), pf, &curline, "")) {
+ while (lp = getaline(line, sizeof (line), pf, &curline, "")) {
check_getname(lp, user, WHITE, COLON, ""); /* username */
if (user[0] == '-' || user[0] == '+') {
continue; /* NIS entry */
@@ -291,7 +287,7 @@ dohostfile(hostfile, hf)
curfile = hostfile;
curline = 0;
- while (lp = getline(line, sizeof (line), hf, &curline, "#")) {
+ while (lp = getaline(line, sizeof (line), hf, &curline, "#")) {
check_getname(lp, name, WHITE, WHITE, "#");
if (getname(name, MAXNAMELEN, WHITE, WHITE, lp, "#") != 1) {
continue;
diff --git a/usr/src/cmd/ypcmd/revnetgroup/revnetgroup.c b/usr/src/cmd/ypcmd/revnetgroup/revnetgroup.c
index 41f161e913..f19a33cd4d 100644
--- a/usr/src/cmd/ypcmd/revnetgroup/revnetgroup.c
+++ b/usr/src/cmd/ypcmd/revnetgroup/revnetgroup.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,16 +18,13 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 1994, by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-
+
/*
* For SUNWnskit - version 1.1
- *
- * Based on:
- * #pragma ident "%Z%%M% %I% %E% SMI" (SMI4.1 1.6)
*/
#include <stdlib.h>
@@ -277,7 +273,7 @@ loadtable(FILE *nf)
char *group;
char *line;
- while (getline(buf, MAXGROUPLEN, nf)) {
+ while (getaline(buf, MAXGROUPLEN, nf)) {
for (p = buf; *p && isspace((int)*p); p++)
; /* skip leading blanks */
for (; *p && *p != '#' && *p != ' ' && *p != '\t'; p++)
diff --git a/usr/src/cmd/ypcmd/revnetgroup/util.c b/usr/src/cmd/ypcmd/revnetgroup/util.c
index 511bf34b5b..cde75016b5 100644
--- a/usr/src/cmd/ypcmd/revnetgroup/util.c
+++ b/usr/src/cmd/ypcmd/revnetgroup/util.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,13 +18,11 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 1996-2001 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI" /* SMI4.1 1.4 */
-
#include <stdio.h>
#include <string.h>
#include "util.h"
@@ -38,7 +35,7 @@
* of a line
*/
char *
-getline(line, maxlen, fp)
+getaline(line, maxlen, fp)
char *line;
int maxlen;
FILE *fp;
diff --git a/usr/src/cmd/ypcmd/revnetgroup/util.h b/usr/src/cmd/ypcmd/revnetgroup/util.h
index e83ba1ed0f..3a6db7ffd7 100644
--- a/usr/src/cmd/ypcmd/revnetgroup/util.h
+++ b/usr/src/cmd/ypcmd/revnetgroup/util.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,17 +18,14 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1995 Sun Microsystems Inc.
- * All rights reserved.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-
#ifndef __UTIL_H
#define __UTIL_H
-#pragma ident "%Z%%M% %I% %E% SMI" /* SMI4.1 1.5 */
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -57,7 +53,7 @@ extern char *malloc();
*/
extern char *alloca();
-char *getline();
+char *getaline();
void fatal();
#ifdef __cplusplus