diff options
| author | Palle Lyckegaard <palle@lyckegaard.dk> | 2008-10-29 22:28:53 -0400 |
|---|---|---|
| committer | Palle Lyckegaard <palle@lyckegaard.dk> | 2008-10-29 22:28:53 -0400 |
| commit | 406d62731eff92f06723c04de94992d94a293145 (patch) | |
| tree | 82964992dfe4bbe8186a3a95491534a28ad50955 /usr | |
| parent | 3b11abfaf709999edad1b6e40bd7c7a8442664d8 (diff) | |
| download | illumos-joyent-406d62731eff92f06723c04de94992d94a293145.tar.gz | |
6442434 Solaris should have AF_LOCAL/PF_LOCAL/AF_FILE/PF_FILE as synonyms for AF_UNIX/PF_UNIX
Contributed by Palle Lyckegaard <palle@lyckegaard.dk>
Diffstat (limited to 'usr')
| -rw-r--r-- | usr/src/cmd/auditreduce/auditrt.h | 6 | ||||
| -rw-r--r-- | usr/src/cmd/auditreduce/option.c | 13 | ||||
| -rw-r--r-- | usr/src/cmd/auditreduce/proc.c | 13 | ||||
| -rw-r--r-- | usr/src/uts/common/sys/socket.h | 6 | ||||
| -rw-r--r-- | usr/src/uts/common/sys/un.h | 18 |
5 files changed, 30 insertions, 26 deletions
diff --git a/usr/src/cmd/auditreduce/auditrt.h b/usr/src/cmd/auditreduce/auditrt.h index df27b8016f..cd1356e7b3 100644 --- a/usr/src/cmd/auditreduce/auditrt.h +++ b/usr/src/cmd/auditreduce/auditrt.h @@ -19,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _AUDITRT_H #define _AUDITRT_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -111,7 +109,7 @@ typedef struct audit_pcb audit_pcb_t; */ #define PF_ROOT 0x01 /* current pcb is the root of process tree */ #define PF_LEAF 0x02 /* current pcb is a leaf of process tree */ -#define PF_FILE 0x04 /* current pcb uses files as input, not pipes */ +#define PF_USEFILE 0x04 /* current pcb uses files as input, not pipes */ /* * Message selection options diff --git a/usr/src/cmd/auditreduce/option.c b/usr/src/cmd/auditreduce/option.c index 28e31a0d29..3dfe91f779 100644 --- a/usr/src/cmd/auditreduce/option.c +++ b/usr/src/cmd/auditreduce/option.c @@ -23,7 +23,6 @@ * Use is subject to license terms. */ - /* * Command line option processing for auditreduce. * The entry point is process_options(), which is called by main(). @@ -220,8 +219,8 @@ start_over: } if (error) { (void) fprintf(stderr, - gettext("%s command line error - %s.\n"), - ar, error_str); + gettext("%s command line error - %s.\n"), + ar, error_str); return (-1); } } @@ -253,7 +252,7 @@ start_over: } if (m_after >= m_before) { error_str = - gettext("'a' parameter must be before 'b' parameter"); + gettext("'a' parameter must be before 'b' parameter"); error_combo = TRUE; } if (f_delete && @@ -370,8 +369,8 @@ proc_object(char *optarg) if (he->h_addrtype == AF_INET6) { /* LINTED */ - if (IN6_IS_ADDR_V4MAPPED((in6_addr_t *) - he->h_addr_list[0])) { + if (IN6_IS_ADDR_V4MAPPED( + (in6_addr_t *)he->h_addr_list[0])) { /* address is IPv4 (32 bits) */ (void) memcpy(&obj_id, he->h_addr_list[0], 4); ip_type = AU_IPv4; @@ -1132,7 +1131,7 @@ proc_pcb(audit_pcb_t *pcb, char *suffix, int i) pcb->pcb_size = AUDITBUFSIZE; pcb->pcb_rec = (char *)a_calloc(1, AUDITBUFSIZE); pcb->pcb_time = -1; - pcb->pcb_flags |= PF_FILE; /* note this one controls files */ + pcb->pcb_flags |= PF_USEFILE; /* note this one controls files */ pcb->pcb_procno = i; /* save index into audit_pcbs [] for id */ } diff --git a/usr/src/cmd/auditreduce/proc.c b/usr/src/cmd/auditreduce/proc.c index 2de2465990..455af400de 100644 --- a/usr/src/cmd/auditreduce/proc.c +++ b/usr/src/cmd/auditreduce/proc.c @@ -23,7 +23,6 @@ * Use is subject to license terms. */ - /* * Main processor for auditreduce. * Mproc() is the entry point for this module. It is the only visible @@ -482,7 +481,7 @@ int *nr; * Must be check here because the start time of the file name * may be after the first record(s). */ - if (pcb->pcb_nrecs == 0 && (pcb->pcb_flags & PF_FILE)) { + if (pcb->pcb_nrecs == 0 && (pcb->pcb_flags & PF_USEFILE)) { /* * If the first record read failed then use the time * that was in the filename to judge. @@ -509,7 +508,7 @@ int *nr; pcb->pcb_nrecs++; /* # of read recs from stream */ nrecs++; /* # of recs read this call */ /* Only check record if at bottom of process tree. */ - if (pcb->pcb_flags & PF_FILE) { + if (pcb->pcb_flags & PF_USEFILE) { check_order(pcb); /* check time sequence */ if ((ret2 = check_rec(pcb)) == 0) { pcb->pcb_nprecs++; @@ -541,7 +540,7 @@ int *nr; if (ret < 0 || ret2 == -2) { pcb->pcb_nrecs++; /* # of read records */ if (!f_quiet) { - if (pcb->pcb_flags & PF_FILE) { + if (pcb->pcb_flags & PF_USEFILE) { /* Ignore if this is not_terminated. */ if (!strstr((pcb->pcb_cur)->fcb_file, "not_terminated")) { @@ -558,12 +557,12 @@ int *nr; * Only mark infile for deleting if we have succesfully * processed all of it. */ - if (pcb->pcb_flags & PF_FILE) + if (pcb->pcb_flags & PF_USEFILE) (pcb->pcb_cur)->fcb_flags |= FF_DELETE; } if (fclose(pcb->pcb_fpr) == EOF) { if (!f_quiet) { - if (pcb->pcb_flags & PF_FILE) { + if (pcb->pcb_flags & PF_USEFILE) { str = (pcb->pcb_cur)->fcb_file; } else { str = "pipe"; @@ -600,7 +599,7 @@ audit_pcb_t *pcb; /* * For file give filename, too. */ - if (pcb->pcb_flags & PF_FILE) { + if (pcb->pcb_flags & PF_USEFILE) { (void) fprintf(stderr, "%s closed %s: %d records read recs: \ %d record written.\n", ar, (pcb->pcb_cur)->fcb_file, pcb->pcb_nrecs, pcb->pcb_nprecs); diff --git a/usr/src/uts/common/sys/socket.h b/usr/src/uts/common/sys/socket.h index a8e1d90217..0432b529be 100644 --- a/usr/src/uts/common/sys/socket.h +++ b/usr/src/uts/common/sys/socket.h @@ -39,8 +39,6 @@ #ifndef _SYS_SOCKET_H #define _SYS_SOCKET_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/uio.h> #include <sys/feature_tests.h> @@ -193,6 +191,8 @@ struct linger { */ #define AF_UNSPEC 0 /* unspecified */ #define AF_UNIX 1 /* local to host (pipes, portals) */ +#define AF_LOCAL AF_UNIX /* Synonym for AF_UNIX */ +#define AF_FILE AF_UNIX /* Synonym for AF_UNIX */ #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ #define AF_IMPLINK 3 /* arpanet imp addresses */ #define AF_PUP 4 /* pup protocols: e.g. BSP */ @@ -230,6 +230,8 @@ struct linger { */ #define PF_UNSPEC AF_UNSPEC #define PF_UNIX AF_UNIX +#define PF_LOCAL PF_UNIX +#define PF_FILE PF_UNIX #define PF_INET AF_INET #define PF_IMPLINK AF_IMPLINK #define PF_PUP AF_PUP diff --git a/usr/src/uts/common/sys/un.h b/usr/src/uts/common/sys/un.h index 1804d5850f..1e7ce86699 100644 --- a/usr/src/uts/common/sys/un.h +++ b/usr/src/uts/common/sys/un.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. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 1996 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -40,8 +39,6 @@ #ifndef _SYS_UN_H #define _SYS_UN_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -59,6 +56,15 @@ struct sockaddr_un { char sun_path[108]; /* path name (gag) */ }; +/* + * NOTE: If we ever go to BSD-style sun_len + sun_family, this macro needs to + * change. + * + * Also, include a strlen() prototype. + */ +extern size_t strlen(const char *); +#define SUN_LEN(su) (sizeof (sa_family_t) + strlen((su)->sun_path)) + #ifdef _KERNEL int unp_discard(); #endif |
