Index: sys/cam/scsi/scsi_all.c =================================================================== --- sys/cam/scsi/scsi_all.c (revision 242394) +++ sys/cam/scsi/scsi_all.c (working copy) @@ -699,20 +699,20 @@ { SSD_KEY_NO_SENSE, SS_NOP, "NO SENSE" }, { SSD_KEY_RECOVERED_ERROR, SS_NOP|SSQ_PRINT_SENSE, "RECOVERED ERROR" }, { - SSD_KEY_NOT_READY, SS_TUR|SSQ_MANY|SSQ_DECREMENT_COUNT|EBUSY, + SSD_KEY_NOT_READY, SS_TUR|SSQ_MANY|SSQ_DECREMENT_COUNT|__EBUSY, "NOT READY" }, { SSD_KEY_MEDIUM_ERROR, SS_RDEF, "MEDIUM ERROR" }, { SSD_KEY_HARDWARE_ERROR, SS_RDEF, "HARDWARE FAILURE" }, - { SSD_KEY_ILLEGAL_REQUEST, SS_FATAL|EINVAL, "ILLEGAL REQUEST" }, - { SSD_KEY_UNIT_ATTENTION, SS_FATAL|ENXIO, "UNIT ATTENTION" }, - { SSD_KEY_DATA_PROTECT, SS_FATAL|EACCES, "DATA PROTECT" }, - { SSD_KEY_BLANK_CHECK, SS_FATAL|ENOSPC, "BLANK CHECK" }, - { SSD_KEY_Vendor_Specific, SS_FATAL|EIO, "Vendor Specific" }, - { SSD_KEY_COPY_ABORTED, SS_FATAL|EIO, "COPY ABORTED" }, + { SSD_KEY_ILLEGAL_REQUEST, SS_FATAL|__EINVAL, "ILLEGAL REQUEST" }, + { SSD_KEY_UNIT_ATTENTION, SS_FATAL|__ENXIO, "UNIT ATTENTION" }, + { SSD_KEY_DATA_PROTECT, SS_FATAL|__EACCES, "DATA PROTECT" }, + { SSD_KEY_BLANK_CHECK, SS_FATAL|__ENOSPC, "BLANK CHECK" }, + { SSD_KEY_Vendor_Specific, SS_FATAL|__EIO, "Vendor Specific" }, + { SSD_KEY_COPY_ABORTED, SS_FATAL|__EIO, "COPY ABORTED" }, { SSD_KEY_ABORTED_COMMAND, SS_RDEF, "ABORTED COMMAND" }, { SSD_KEY_EQUAL, SS_NOP, "EQUAL" }, - { SSD_KEY_VOLUME_OVERFLOW, SS_FATAL|EIO, "VOLUME OVERFLOW" }, + { SSD_KEY_VOLUME_OVERFLOW, SS_FATAL|__EIO, "VOLUME OVERFLOW" }, { SSD_KEY_MISCOMPARE, SS_NOP, "MISCOMPARE" }, { SSD_KEY_COMPLETED, SS_NOP, "COMPLETED" } }; @@ -721,12 +721,12 @@ sizeof(sense_key_table)/sizeof(sense_key_table[0]); static struct asc_table_entry quantum_fireball_entries[] = { - { SST(0x04, 0x0b, SS_START | SSQ_DECREMENT_COUNT | ENXIO, + { SST(0x04, 0x0b, SS_START | SSQ_DECREMENT_COUNT | __ENXIO, "Logical unit not ready, initializing cmd. required") } }; static struct asc_table_entry sony_mo_entries[] = { - { SST(0x04, 0x00, SS_START | SSQ_DECREMENT_COUNT | ENXIO, + { SST(0x04, 0x00, SS_START | SSQ_DECREMENT_COUNT | __ENXIO, "Logical unit not ready, cause not reportable") } }; @@ -813,7 +813,7 @@ { SST(0x00, 0x07, SS_RDEF, /* XXX TBD */ "Programmable early warning detected") }, /* R */ - { SST(0x00, 0x11, SS_FATAL | EBUSY, + { SST(0x00, 0x11, SS_FATAL | __EBUSY, "Audio play operation in progress") }, /* R */ { SST(0x00, 0x12, SS_NOP, @@ -828,7 +828,7 @@ { SST(0x00, 0x15, SS_NOP, "No current audio status to return") }, /* DTLPWROMAEBKVF */ - { SST(0x00, 0x16, SS_FATAL | EBUSY, + { SST(0x00, 0x16, SS_FATAL | __EBUSY, "Operation in progress") }, /* DTL WROMAEBKVF */ { SST(0x00, 0x17, SS_RDEF, @@ -876,31 +876,31 @@ { SST(0x03, 0x02, SS_RDEF, "Excessive write errors") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x00, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | EIO, + { SST(0x04, 0x00, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | __EIO, "Logical unit not ready, cause not reportable") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x01, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | EBUSY, + { SST(0x04, 0x01, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | __EBUSY, "Logical unit is in process of becoming ready") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x02, SS_START | SSQ_DECREMENT_COUNT | ENXIO, + { SST(0x04, 0x02, SS_START | SSQ_DECREMENT_COUNT | __ENXIO, "Logical unit not ready, initializing command required") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x03, SS_FATAL | ENXIO, + { SST(0x04, 0x03, SS_FATAL | __ENXIO, "Logical unit not ready, manual intervention required") }, /* DTL RO B */ - { SST(0x04, 0x04, SS_FATAL | EBUSY, + { SST(0x04, 0x04, SS_FATAL | __EBUSY, "Logical unit not ready, format in progress") }, /* DT W O A BK F */ - { SST(0x04, 0x05, SS_FATAL | EBUSY, + { SST(0x04, 0x05, SS_FATAL | __EBUSY, "Logical unit not ready, rebuild in progress") }, /* DT W O A BK */ - { SST(0x04, 0x06, SS_FATAL | EBUSY, + { SST(0x04, 0x06, SS_FATAL | __EBUSY, "Logical unit not ready, recalculation in progress") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x07, SS_FATAL | EBUSY, + { SST(0x04, 0x07, SS_FATAL | __EBUSY, "Logical unit not ready, operation in progress") }, /* R */ - { SST(0x04, 0x08, SS_FATAL | EBUSY, + { SST(0x04, 0x08, SS_FATAL | __EBUSY, "Logical unit not ready, long write in progress") }, /* DTLPWROMAEBKVF */ { SST(0x04, 0x09, SS_RDEF, /* XXX TBD */ @@ -996,7 +996,7 @@ { SST(0x09, 0x04, SS_RDEF, "Head select fault") }, /* DTLPWROMAEBKVF */ - { SST(0x0A, 0x00, SS_FATAL | ENOSPC, + { SST(0x0A, 0x00, SS_FATAL | __ENOSPC, "Error log overflow") }, /* DTLPWROMAEBKVF */ { SST(0x0B, 0x00, SS_RDEF, @@ -1125,25 +1125,25 @@ { SST(0x10, 0x05, SS_RDEF, /* XXX TBD */ "Logical block protection method error") }, /* DT WRO BK */ - { SST(0x11, 0x00, SS_FATAL|EIO, + { SST(0x11, 0x00, SS_FATAL|__EIO, "Unrecovered read error") }, /* DT WRO BK */ - { SST(0x11, 0x01, SS_FATAL|EIO, + { SST(0x11, 0x01, SS_FATAL|__EIO, "Read retries exhausted") }, /* DT WRO BK */ - { SST(0x11, 0x02, SS_FATAL|EIO, + { SST(0x11, 0x02, SS_FATAL|__EIO, "Error too long to correct") }, /* DT W O BK */ - { SST(0x11, 0x03, SS_FATAL|EIO, + { SST(0x11, 0x03, SS_FATAL|__EIO, "Multiple read errors") }, /* D W O BK */ - { SST(0x11, 0x04, SS_FATAL|EIO, + { SST(0x11, 0x04, SS_FATAL|__EIO, "Unrecovered read error - auto reallocate failed") }, /* WRO B */ - { SST(0x11, 0x05, SS_FATAL|EIO, + { SST(0x11, 0x05, SS_FATAL|__EIO, "L-EC uncorrectable error") }, /* WRO B */ - { SST(0x11, 0x06, SS_FATAL|EIO, + { SST(0x11, 0x06, SS_FATAL|__EIO, "CIRC unrecovered error") }, /* W O B */ { SST(0x11, 0x07, SS_RDEF, @@ -1158,10 +1158,10 @@ { SST(0x11, 0x0A, SS_RDEF, "Miscorrected error") }, /* D W O BK */ - { SST(0x11, 0x0B, SS_FATAL|EIO, + { SST(0x11, 0x0B, SS_FATAL|__EIO, "Unrecovered read error - recommend reassignment") }, /* D W O BK */ - { SST(0x11, 0x0C, SS_FATAL|EIO, + { SST(0x11, 0x0C, SS_FATAL|__EIO, "Unrecovered read error - recommend rewrite the data") }, /* DT WRO B */ { SST(0x11, 0x0D, SS_RDEF, @@ -1338,7 +1338,7 @@ { SST(0x1F, 0x00, SS_RDEF, "Partial defect list transfer") }, /* DTLPWROMAEBKVF */ - { SST(0x20, 0x00, SS_FATAL | EINVAL, + { SST(0x20, 0x00, SS_FATAL | __EINVAL, "Invalid command operation code") }, /* DT PWROMAEBK */ { SST(0x20, 0x01, SS_RDEF, /* XXX TBD */ @@ -1374,13 +1374,13 @@ { SST(0x20, 0x0B, SS_RDEF, /* XXX TBD */ "Access denied - ACL LUN conflict") }, /* T */ - { SST(0x20, 0x0C, SS_FATAL | EINVAL, + { SST(0x20, 0x0C, SS_FATAL | __EINVAL, "Illegal command when not in append-only mode") }, /* DT WRO BK */ - { SST(0x21, 0x00, SS_FATAL | EINVAL, + { SST(0x21, 0x00, SS_FATAL | __EINVAL, "Logical block address out of range") }, /* DT WROM BK */ - { SST(0x21, 0x01, SS_FATAL | EINVAL, + { SST(0x21, 0x01, SS_FATAL | __EINVAL, "Invalid element address") }, /* R */ { SST(0x21, 0x02, SS_RDEF, /* XXX TBD */ @@ -1389,7 +1389,7 @@ { SST(0x21, 0x03, SS_RDEF, /* XXX TBD */ "Invalid write crossing layer jump") }, /* D */ - { SST(0x22, 0x00, SS_FATAL | EINVAL, + { SST(0x22, 0x00, SS_FATAL | __EINVAL, "Illegal function (use 20 00, 24 00, or 26 00)") }, /* DT P B */ { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */ @@ -1425,7 +1425,7 @@ { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */ "Invalid token operation, invalid token length") }, /* DTLPWROMAEBKVF */ - { SST(0x24, 0x00, SS_FATAL | EINVAL, + { SST(0x24, 0x00, SS_FATAL | __EINVAL, "Invalid field in CDB") }, /* DTLPWRO AEBKVF */ { SST(0x24, 0x01, SS_RDEF, /* XXX TBD */ @@ -1452,22 +1452,22 @@ { SST(0x24, 0x08, SS_RDEF, /* XXX TBD */ "Invalid XCDB") }, /* DTLPWROMAEBKVF */ - { SST(0x25, 0x00, SS_FATAL | ENXIO, + { SST(0x25, 0x00, SS_FATAL | __ENXIO, "Logical unit not supported") }, /* DTLPWROMAEBKVF */ - { SST(0x26, 0x00, SS_FATAL | EINVAL, + { SST(0x26, 0x00, SS_FATAL | __EINVAL, "Invalid field in parameter list") }, /* DTLPWROMAEBKVF */ - { SST(0x26, 0x01, SS_FATAL | EINVAL, + { SST(0x26, 0x01, SS_FATAL | __EINVAL, "Parameter not supported") }, /* DTLPWROMAEBKVF */ - { SST(0x26, 0x02, SS_FATAL | EINVAL, + { SST(0x26, 0x02, SS_FATAL | __EINVAL, "Parameter value invalid") }, /* DTLPWROMAE K */ - { SST(0x26, 0x03, SS_FATAL | EINVAL, + { SST(0x26, 0x03, SS_FATAL | __EINVAL, "Threshold parameters not supported") }, /* DTLPWROMAEBKVF */ - { SST(0x26, 0x04, SS_FATAL | EINVAL, + { SST(0x26, 0x04, SS_FATAL | __EINVAL, "Invalid release of persistent reservation") }, /* DTLPWRO A BK */ { SST(0x26, 0x05, SS_RDEF, /* XXX TBD */ @@ -1512,22 +1512,22 @@ { SST(0x26, 0x12, SS_RDEF, /* XXX TBD */ "Vendor specific key reference not found") }, /* DT WRO BK */ - { SST(0x27, 0x00, SS_FATAL | EACCES, + { SST(0x27, 0x00, SS_FATAL | __EACCES, "Write protected") }, /* DT WRO BK */ - { SST(0x27, 0x01, SS_FATAL | EACCES, + { SST(0x27, 0x01, SS_FATAL | __EACCES, "Hardware write protected") }, /* DT WRO BK */ - { SST(0x27, 0x02, SS_FATAL | EACCES, + { SST(0x27, 0x02, SS_FATAL | __EACCES, "Logical unit software write protected") }, /* T R */ - { SST(0x27, 0x03, SS_FATAL | EACCES, + { SST(0x27, 0x03, SS_FATAL | __EACCES, "Associated write protect") }, /* T R */ - { SST(0x27, 0x04, SS_FATAL | EACCES, + { SST(0x27, 0x04, SS_FATAL | __EACCES, "Persistent write protect") }, /* T R */ - { SST(0x27, 0x05, SS_FATAL | EACCES, + { SST(0x27, 0x05, SS_FATAL | __EACCES, "Permanent write protect") }, /* R F */ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ @@ -1536,10 +1536,10 @@ { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ - { SST(0x28, 0x00, SS_FATAL | ENXIO, + { SST(0x28, 0x00, SS_FATAL | __ENXIO, "Not ready to ready change, medium may have changed") }, /* DT WROM B */ - { SST(0x28, 0x01, SS_FATAL | ENXIO, + { SST(0x28, 0x01, SS_FATAL | __ENXIO, "Import or export element accessed") }, /* R */ { SST(0x28, 0x02, SS_RDEF, /* XXX TBD */ @@ -1553,7 +1553,7 @@ * the networking errnos? ECONNRESET anyone? */ /* DTLPWROMAEBKVF */ - { SST(0x29, 0x00, SS_FATAL | ENXIO, + { SST(0x29, 0x00, SS_FATAL | __ENXIO, "Power on, reset, or bus device reset occurred") }, /* DTLPWROMAEBKVF */ { SST(0x29, 0x01, SS_RDEF, @@ -1811,13 +1811,13 @@ { SST(0x39, 0x00, SS_RDEF, "Saving parameters not supported") }, /* DTL WROM BK */ - { SST(0x3A, 0x00, SS_FATAL | ENXIO, + { SST(0x3A, 0x00, SS_FATAL | __ENXIO, "Medium not present") }, /* DT WROM BK */ - { SST(0x3A, 0x01, SS_FATAL | ENXIO, + { SST(0x3A, 0x01, SS_FATAL | __ENXIO, "Medium not present - tray closed") }, /* DT WROM BK */ - { SST(0x3A, 0x02, SS_FATAL | ENXIO, + { SST(0x3A, 0x02, SS_FATAL | __ENXIO, "Medium not present - tray open") }, /* DT WROM B */ { SST(0x3A, 0x03, SS_RDEF, /* XXX TBD */ @@ -1865,7 +1865,7 @@ { SST(0x3B, 0x0C, SS_RDEF, "Position past beginning of medium") }, /* DT WROM BK */ - { SST(0x3B, 0x0D, SS_FATAL | ENOSPC, + { SST(0x3B, 0x0D, SS_FATAL | __ENOSPC, "Medium destination element full") }, /* DT WROM BK */ { SST(0x3B, 0x0E, SS_RDEF, @@ -2163,7 +2163,7 @@ { SST(0x55, 0x00, SS_RDEF, "System resource failure") }, /* D O BK */ - { SST(0x55, 0x01, SS_FATAL | ENOSPC, + { SST(0x55, 0x01, SS_FATAL | __ENOSPC, "System buffer full") }, /* DTLPWROMAE K */ { SST(0x55, 0x02, SS_RDEF, /* XXX TBD */ @@ -2559,10 +2559,10 @@ { SST(0x63, 0x00, SS_RDEF, "End of user area encountered on this track") }, /* R */ - { SST(0x63, 0x01, SS_FATAL | ENOSPC, + { SST(0x63, 0x01, SS_FATAL | __ENOSPC, "Packet does not fit in available space") }, /* R */ - { SST(0x64, 0x00, SS_FATAL | ENXIO, + { SST(0x64, 0x00, SS_FATAL | __ENXIO, "Illegal mode for this track") }, /* R */ { SST(0x64, 0x01, SS_RDEF, @@ -2718,7 +2718,7 @@ { SST(0x73, 0x01, SS_RDEF, "Power calibration area almost full") }, /* R */ - { SST(0x73, 0x02, SS_FATAL | ENOSPC, + { SST(0x73, 0x02, SS_FATAL | __ENOSPC, "Power calibration area is full") }, /* R */ { SST(0x73, 0x03, SS_RDEF, Index: sys/cam/scsi/scsi_all.h =================================================================== --- sys/cam/scsi/scsi_all.h (revision 242394) +++ sys/cam/scsi/scsi_all.h (working copy) @@ -95,7 +95,7 @@ #define SS_ERRMASK 0xff /* The default, retyable, error action */ -#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO +#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|__EIO /* The retyable, error action, with table specified error code */ #define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE Index: sys/netinet/sctp_usrreq.c =================================================================== --- sys/netinet/sctp_usrreq.c (revision 242394) +++ sys/netinet/sctp_usrreq.c (working copy) @@ -3007,7 +3007,7 @@ } case SCTP_RECVRCVINFO: { - int onoff; + int onoff = 0; if (*optsize < sizeof(int)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -3026,7 +3026,7 @@ } case SCTP_RECVNXTINFO: { - int onoff; + int onoff = 0; if (*optsize < sizeof(int)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); Index: sys/netinet/in_mcast.c =================================================================== --- sys/netinet/in_mcast.c (revision 242394) +++ sys/netinet/in_mcast.c (working copy) @@ -2523,7 +2523,7 @@ * allows us to deal with page faults up-front. */ if (msfr.msfr_nsrcs > 0) { - struct in_msource *lims; + struct in_msource *lims = NULL; struct sockaddr_in *psin; struct sockaddr_storage *kss, *pkss; int i; Index: sys/netinet/tcp_output.c =================================================================== --- sys/netinet/tcp_output.c (revision 242394) +++ sys/netinet/tcp_output.c (working copy) @@ -1316,16 +1316,16 @@ out: SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ switch (error) { - case EPERM: + case __EPERM: tp->t_softerror = error; return (error); - case ENOBUFS: + case __ENOBUFS: if (!tcp_timer_active(tp, TT_REXMT) && !tcp_timer_active(tp, TT_PERSIST)) tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); tp->snd_cwnd = tp->t_maxseg; return (0); - case EMSGSIZE: + case __EMSGSIZE: /* * For some reason the interface we used initially * to send segments changed to another or lowered @@ -1342,10 +1342,10 @@ goto again; } return (error); - case EHOSTDOWN: - case EHOSTUNREACH: - case ENETDOWN: - case ENETUNREACH: + case __EHOSTDOWN: + case __EHOSTUNREACH: + case __ENETDOWN: + case __ENETUNREACH: if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_softerror = error; return (0); Index: sys/netinet/ip_input.c =================================================================== --- sys/netinet/ip_input.c (revision 242394) +++ sys/netinet/ip_input.c (working copy) @@ -1330,11 +1330,11 @@ u_char inetctlerrmap[PRC_NCMDS] = { 0, 0, 0, 0, - 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, - EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, - EMSGSIZE, EHOSTUNREACH, 0, 0, - 0, 0, EHOSTUNREACH, 0, - ENOPROTOOPT, ECONNREFUSED + 0, __EMSGSIZE, __EHOSTDOWN, __EHOSTUNREACH, + __EHOSTUNREACH, __EHOSTUNREACH, __ECONNREFUSED, __ECONNREFUSED, + __EMSGSIZE, __EHOSTUNREACH, 0, 0, + 0, 0, __EHOSTUNREACH, 0, + __ENOPROTOOPT, __ECONNREFUSED }; /* @@ -1513,16 +1513,16 @@ /* type, code set above */ break; - case ENETUNREACH: - case EHOSTUNREACH: - case ENETDOWN: - case EHOSTDOWN: + case __ENETUNREACH: + case __EHOSTUNREACH: + case __ENETDOWN: + case __EHOSTDOWN: default: type = ICMP_UNREACH; code = ICMP_UNREACH_HOST; break; - case EMSGSIZE: + case __EMSGSIZE: type = ICMP_UNREACH; code = ICMP_UNREACH_NEEDFRAG; @@ -1552,7 +1552,7 @@ IPSTAT_INC(ips_cantfrag); break; - case ENOBUFS: + case __ENOBUFS: /* * A router should not generate ICMP_SOURCEQUENCH as * required in RFC1812 Requirements for IP Version 4 Routers. @@ -1572,7 +1572,7 @@ } break; - case EACCES: /* ipfw denied packet */ + case __EACCES: /* ipfw denied packet */ m_freem(mcopy); if (ia != NULL) ifa_free(&ia->ia_ifa); Index: sys/fs/fuse/fuse_vnops.c =================================================================== --- sys/fs/fuse/fuse_vnops.c (revision 242394) +++ sys/fs/fuse/fuse_vnops.c (working copy) @@ -729,7 +729,7 @@ atomic_add_acq_long(&fuse_lookup_cache_misses, 1); break; - case ENOENT: /* negative match */ + case __ENOENT: /* negative match */ /* fall through */ default: return err; Index: sys/fs/fuse/fuse_vfsops.c =================================================================== --- sys/fs/fuse/fuse_vfsops.c (revision 242394) +++ sys/fs/fuse/fuse_vfsops.c (working copy) @@ -214,7 +214,7 @@ size_t len; - struct cdev *fdev; + struct cdev *fdev = NULL; struct fuse_data *data; struct thread *td; struct file *fp, *fptmp; Index: sys/fs/nfsserver/nfs_nfsdsubs.c =================================================================== --- sys/fs/nfsserver/nfs_nfsdsubs.c (revision 242394) +++ sys/fs/nfsserver/nfs_nfsdsubs.c (working copy) @@ -70,7 +70,7 @@ * Use NFSERR_IO as the catch all for ones not specifically defined in * RFC 1094. */ -static u_char nfsrv_v2errmap[ELAST] = { +static u_char nfsrv_v2errmap[__ELAST] = { NFSERR_PERM, NFSERR_NOENT, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_NXIO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_IO, NFSERR_ACCES, NFSERR_IO, NFSERR_IO, Index: sys/nfsserver/nfs_srvsubs.c =================================================================== --- sys/nfsserver/nfs_srvsubs.c (revision 242394) +++ sys/nfsserver/nfs_srvsubs.c (working copy) @@ -156,7 +156,7 @@ * Use 0 (which gets converted to NFSERR_IO) as the catch all for ones not * specifically defined in RFC 1094. */ -static const u_char nfsrv_v2errmap[ELAST] = { +static const u_char nfsrv_v2errmap[__ELAST] = { NFSERR_PERM, NFSERR_NOENT, 0, 0, 0, NFSERR_NXIO, 0, 0, 0, 0, 0, 0, NFSERR_ACCES, 0, 0, Index: sys/netsmb/smb_trantcp.c =================================================================== --- sys/netsmb/smb_trantcp.c (revision 242394) +++ sys/netsmb/smb_trantcp.c (working copy) @@ -664,9 +664,9 @@ smb_nbst_fatal(struct smb_vc *vcp, int error) { switch (error) { - case ENOTCONN: - case ENETRESET: - case ECONNABORTED: + case __ENOTCONN: + case __ENETRESET: + case __ECONNABORTED: return 1; } return 0; Index: sys/ddb/db_command.c =================================================================== --- sys/ddb/db_command.c (revision 242394) +++ sys/ddb/db_command.c (working copy) @@ -539,10 +539,10 @@ if (error) { db_printf("Cannot dump: "); switch (error) { - case EBUSY: + case __EBUSY: db_printf("debugger got invoked while dumping.\n"); break; - case ENXIO: + case __ENXIO: db_printf("no dump device specified.\n"); break; default: Index: sys/netinet6/ip6_input.c =================================================================== --- sys/netinet6/ip6_input.c (revision 242394) +++ sys/netinet6/ip6_input.c (working copy) @@ -1878,9 +1878,9 @@ u_char inet6ctlerrmap[PRC_NCMDS] = { 0, 0, 0, 0, - 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, - EHOSTUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED, - EMSGSIZE, EHOSTUNREACH, 0, 0, + 0, __EMSGSIZE, __EHOSTDOWN, __EHOSTUNREACH, + __EHOSTUNREACH, __EHOSTUNREACH, __ECONNREFUSED, __ECONNREFUSED, + __EMSGSIZE, __EHOSTUNREACH, 0, 0, 0, 0, 0, 0, - ENOPROTOOPT + __ENOPROTOOPT }; Index: sys/netinet6/in6_mcast.c =================================================================== --- sys/netinet6/in6_mcast.c (revision 242394) +++ sys/netinet6/in6_mcast.c (working copy) @@ -2436,7 +2436,7 @@ * allows us to deal with page faults up-front. */ if (msfr.msfr_nsrcs > 0) { - struct in6_msource *lims; + struct in6_msource *lims = NULL; struct sockaddr_in6 *psin; struct sockaddr_storage *kss, *pkss; int i; Index: sys/netinet6/ip6_output.c =================================================================== --- sys/netinet6/ip6_output.c (revision 242394) +++ sys/netinet6/ip6_output.c (working copy) @@ -453,17 +453,17 @@ /* mbuf is already reclaimed in ipsec6_output_trans. */ m = NULL; switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: + case __EHOSTUNREACH: + case __ENETUNREACH: + case __EMSGSIZE: + case __ENOBUFS: + case __ENOMEM: break; default: printf("[%s:%d] (ipsec): error code %d\n", __func__, __LINE__, error); /* FALLTHROUGH */ - case ENOENT: + case __ENOENT: /* don't show these error codes to the user */ error = 0; break; @@ -602,17 +602,17 @@ m0 = m = NULL; m = NULL; switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: + case __EHOSTUNREACH: + case __ENETUNREACH: + case __EMSGSIZE: + case __ENOBUFS: + case __ENOMEM: break; default: printf("[%s:%d] (ipsec): error code %d\n", __func__, __LINE__, error); /* FALLTHROUGH */ - case ENOENT: + case __ENOENT: /* don't show these error codes to the user */ error = 0; break; @@ -646,10 +646,10 @@ } else if ((error = in6_selectroute_fib(&dst_sa, opt, im6o, ro, &ifp, &rt, inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m))) != 0) { switch (error) { - case EHOSTUNREACH: + case __EHOSTUNREACH: V_ip6stat.ip6s_noroute++; break; - case EADDRNOTAVAIL: + case __EADDRNOTAVAIL: default: break; /* XXX statistics? */ } @@ -1050,7 +1050,7 @@ goto bad; } else { struct mbuf **mnext, *m_frgpart; - struct ip6_frag *ip6f; + struct ip6_frag *ip6f = NULL; u_int32_t id = htonl(ip6_randomid()); u_char nextproto; Index: sys/netinet6/ip6_forward.c =================================================================== --- sys/netinet6/ip6_forward.c (revision 242394) +++ sys/netinet6/ip6_forward.c (working copy) @@ -297,16 +297,16 @@ if (error) { /* mbuf is already reclaimed in ipsec6_output_tunnel. */ switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: + case __EHOSTUNREACH: + case __ENETUNREACH: + case __EMSGSIZE: + case __ENOBUFS: + case __ENOMEM: break; default: printf("ip6_output (ipsec): error code %d\n", error); /* FALLTHROUGH */ - case ENOENT: + case __ENOENT: /* don't show these error codes to the user */ break; } @@ -647,18 +647,18 @@ } goto freecopy; - case EMSGSIZE: + case __EMSGSIZE: /* xxx MTU is constant in PPP? */ goto freecopy; - case ENOBUFS: + case __ENOBUFS: /* Tell source to slow down like source quench in IP? */ goto freecopy; - case ENETUNREACH: /* shouldn't happen, checked above */ - case EHOSTUNREACH: - case ENETDOWN: - case EHOSTDOWN: + case __ENETUNREACH: /* shouldn't happen, checked above */ + case __EHOSTUNREACH: + case __ENETDOWN: + case __EHOSTDOWN: default: type = ICMP6_DST_UNREACH; code = ICMP6_DST_UNREACH_ADDR; Index: sys/contrib/rdma/rdma_cma.c =================================================================== --- sys/contrib/rdma/rdma_cma.c (revision 242394) +++ sys/contrib/rdma/rdma_cma.c (working copy) @@ -1256,11 +1256,11 @@ case 0: event.event = RDMA_CM_EVENT_ESTABLISHED; break; - case ECONNRESET: - case ECONNREFUSED: + case __ECONNRESET: + case __ECONNREFUSED: event.event = RDMA_CM_EVENT_REJECTED; break; - case ETIMEDOUT: + case __ETIMEDOUT: event.event = RDMA_CM_EVENT_UNREACHABLE; break; default: @@ -1916,7 +1916,7 @@ unsigned short snum) { struct rdma_bind_list *bind_list; - int port, ret; + int port = 0, ret; bind_list = malloc(sizeof *bind_list, M_DEVBUF, M_NOWAIT); if (!bind_list) @@ -1949,7 +1949,7 @@ static int cma_alloc_any_port(struct kvl *ps, struct rdma_id_private *id_priv) { struct rdma_bind_list *bind_list; - int port, ret; + int port = 0, ret; bind_list = malloc(sizeof *bind_list, M_DEVBUF, M_NOWAIT); if (!bind_list) Index: sys/contrib/rdma/rdma_addr.c =================================================================== --- sys/contrib/rdma/rdma_addr.c (revision 242394) +++ sys/contrib/rdma/rdma_addr.c (working copy) @@ -303,7 +303,7 @@ req->timeout = ticks; queue_req(req); break; - case EWOULDBLOCK: + case __EWOULDBLOCK: req->timeout = msecs_to_ticks(timeout_ms) + ticks; queue_req(req); #ifdef needed Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c (revision 242394) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c (working copy) @@ -872,7 +872,7 @@ else error = ENOENT; switch (error) { - case ENOENT: + case __ENOENT: sa->sa_user_table[i] = (sa_attr_type_t)sa_attr_count; sa_attr_count++; break; Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c (revision 242394) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c (working copy) @@ -2557,7 +2557,7 @@ ZIO_TRIM_STAT_INCR(zio_trim_bytes, zio->io_size); ZIO_TRIM_STAT_BUMP(zio_trim_success); break; - case EOPNOTSUPP: + case __EOPNOTSUPP: ZIO_TRIM_STAT_BUMP(zio_trim_unsupported); break; default: @@ -2722,7 +2722,8 @@ int zio_worst_error(int e1, int e2) { - static int zio_error_rank[] = { 0, ENXIO, ECKSUM, EIO }; + /* XXXGL: losing error tracing here. */ + static int zio_error_rank[] = { 0, __ENXIO, ECKSUM, __EIO }; int r1, r2; for (r1 = 0; r1 < sizeof (zio_error_rank) / sizeof (int); r1++) Index: sys/security/audit/audit_bsm_errno.c =================================================================== --- sys/security/audit/audit_bsm_errno.c (revision 242394) +++ sys/security/audit/audit_bsm_errno.c (working copy) @@ -83,42 +83,42 @@ */ static const struct bsm_errno bsm_errnos[] = { { BSM_ERRNO_ESUCCESS, 0, ES("Success") }, - { BSM_ERRNO_EPERM, EPERM, ES("Operation not permitted") }, - { BSM_ERRNO_ENOENT, ENOENT, ES("No such file or directory") }, - { BSM_ERRNO_ESRCH, ESRCH, ES("No such process") }, - { BSM_ERRNO_EINTR, EINTR, ES("Interrupted system call") }, - { BSM_ERRNO_EIO, EIO, ES("Input/output error") }, - { BSM_ERRNO_ENXIO, ENXIO, ES("Device not configured") }, - { BSM_ERRNO_E2BIG, E2BIG, ES("Argument list too long") }, - { BSM_ERRNO_ENOEXEC, ENOEXEC, ES("Exec format error") }, - { BSM_ERRNO_EBADF, EBADF, ES("Bad file descriptor") }, - { BSM_ERRNO_ECHILD, ECHILD, ES("No child processes") }, - { BSM_ERRNO_EAGAIN, EAGAIN, ES("Resource temporarily unavailable") }, - { BSM_ERRNO_ENOMEM, ENOMEM, ES("Cannot allocate memory") }, - { BSM_ERRNO_EACCES, EACCES, ES("Permission denied") }, - { BSM_ERRNO_EFAULT, EFAULT, ES("Bad address") }, - { BSM_ERRNO_ENOTBLK, ENOTBLK, ES("Block device required") }, - { BSM_ERRNO_EBUSY, EBUSY, ES("Device busy") }, - { BSM_ERRNO_EEXIST, EEXIST, ES("File exists") }, - { BSM_ERRNO_EXDEV, EXDEV, ES("Cross-device link") }, - { BSM_ERRNO_ENODEV, ENODEV, ES("Operation not supported by device") }, - { BSM_ERRNO_ENOTDIR, ENOTDIR, ES("Not a directory") }, - { BSM_ERRNO_EISDIR, EISDIR, ES("Is a directory") }, - { BSM_ERRNO_EINVAL, EINVAL, ES("Invalid argument") }, - { BSM_ERRNO_ENFILE, ENFILE, ES("Too many open files in system") }, - { BSM_ERRNO_EMFILE, EMFILE, ES("Too many open files") }, - { BSM_ERRNO_ENOTTY, ENOTTY, ES("Inappropriate ioctl for device") }, - { BSM_ERRNO_ETXTBSY, ETXTBSY, ES("Text file busy") }, - { BSM_ERRNO_EFBIG, EFBIG, ES("File too large") }, - { BSM_ERRNO_ENOSPC, ENOSPC, ES("No space left on device") }, - { BSM_ERRNO_ESPIPE, ESPIPE, ES("Illegal seek") }, - { BSM_ERRNO_EROFS, EROFS, ES("Read-only file system") }, - { BSM_ERRNO_EMLINK, EMLINK, ES("Too many links") }, - { BSM_ERRNO_EPIPE, EPIPE, ES("Broken pipe") }, - { BSM_ERRNO_EDOM, EDOM, ES("Numerical argument out of domain") }, - { BSM_ERRNO_ERANGE, ERANGE, ES("Result too large") }, - { BSM_ERRNO_ENOMSG, ENOMSG, ES("No message of desired type") }, - { BSM_ERRNO_EIDRM, EIDRM, ES("Identifier removed") }, + { BSM_ERRNO_EPERM, __EPERM, ES("Operation not permitted") }, + { BSM_ERRNO_ENOENT, __ENOENT, ES("No such file or directory") }, + { BSM_ERRNO_ESRCH, __ESRCH, ES("No such process") }, + { BSM_ERRNO_EINTR, __EINTR, ES("Interrupted system call") }, + { BSM_ERRNO_EIO, __EIO, ES("Input/output error") }, + { BSM_ERRNO_ENXIO, __ENXIO, ES("Device not configured") }, + { BSM_ERRNO_E2BIG, __E2BIG, ES("Argument list too long") }, + { BSM_ERRNO_ENOEXEC, __ENOEXEC, ES("Exec format error") }, + { BSM_ERRNO_EBADF, __EBADF, ES("Bad file descriptor") }, + { BSM_ERRNO_ECHILD, __ECHILD, ES("No child processes") }, + { BSM_ERRNO_EAGAIN, __EAGAIN, ES("Resource temporarily unavailable") }, + { BSM_ERRNO_ENOMEM, __ENOMEM, ES("Cannot allocate memory") }, + { BSM_ERRNO_EACCES, __EACCES, ES("Permission denied") }, + { BSM_ERRNO_EFAULT, __EFAULT, ES("Bad address") }, + { BSM_ERRNO_ENOTBLK, __ENOTBLK, ES("Block device required") }, + { BSM_ERRNO_EBUSY, __EBUSY, ES("Device busy") }, + { BSM_ERRNO_EEXIST, __EEXIST, ES("File exists") }, + { BSM_ERRNO_EXDEV, __EXDEV, ES("Cross-device link") }, + { BSM_ERRNO_ENODEV, __ENODEV, ES("Operation not supported by device") }, + { BSM_ERRNO_ENOTDIR, __ENOTDIR, ES("Not a directory") }, + { BSM_ERRNO_EISDIR, __EISDIR, ES("Is a directory") }, + { BSM_ERRNO_EINVAL, __EINVAL, ES("Invalid argument") }, + { BSM_ERRNO_ENFILE, __ENFILE, ES("Too many open files in system") }, + { BSM_ERRNO_EMFILE, __EMFILE, ES("Too many open files") }, + { BSM_ERRNO_ENOTTY, __ENOTTY, ES("Inappropriate ioctl for device") }, + { BSM_ERRNO_ETXTBSY, __ETXTBSY, ES("Text file busy") }, + { BSM_ERRNO_EFBIG, __EFBIG, ES("File too large") }, + { BSM_ERRNO_ENOSPC, __ENOSPC, ES("No space left on device") }, + { BSM_ERRNO_ESPIPE, __ESPIPE, ES("Illegal seek") }, + { BSM_ERRNO_EROFS, __EROFS, ES("Read-only file system") }, + { BSM_ERRNO_EMLINK, __EMLINK, ES("Too many links") }, + { BSM_ERRNO_EPIPE, __EPIPE, ES("Broken pipe") }, + { BSM_ERRNO_EDOM, __EDOM, ES("Numerical argument out of domain") }, + { BSM_ERRNO_ERANGE, __ERANGE, ES("Result too large") }, + { BSM_ERRNO_ENOMSG, __ENOMSG, ES("No message of desired type") }, + { BSM_ERRNO_EIDRM, __EIDRM, ES("Identifier removed") }, { BSM_ERRNO_ECHRNG, #ifdef ECHRNG ECHRNG, @@ -175,11 +175,11 @@ ERRNO_NO_LOCAL_MAPPING, #endif ES("Level 2 halted") }, - { BSM_ERRNO_EDEADLK, EDEADLK, ES("Resource deadlock avoided") }, - { BSM_ERRNO_ENOLCK, ENOLCK, ES("No locks available") }, - { BSM_ERRNO_ECANCELED, ECANCELED, ES("Operation canceled") }, - { BSM_ERRNO_ENOTSUP, ENOTSUP, ES("Operation not supported") }, - { BSM_ERRNO_EDQUOT, EDQUOT, ES("Disc quota exceeded") }, + { BSM_ERRNO_EDEADLK, __EDEADLK, ES("Resource deadlock avoided") }, + { BSM_ERRNO_ENOLCK, __ENOLCK, ES("No locks available") }, + { BSM_ERRNO_ECANCELED, __ECANCELED, ES("Operation canceled") }, + { BSM_ERRNO_ENOTSUP, __ENOTSUP, ES("Operation not supported") }, + { BSM_ERRNO_EDQUOT, __EDQUOT, ES("Disc quota exceeded") }, { BSM_ERRNO_EBADE, #ifdef EBADE EBADE, @@ -271,11 +271,11 @@ ERRNO_NO_LOCAL_MAPPING, #endif ES("Package not installed") }, - { BSM_ERRNO_EREMOTE, EREMOTE, + { BSM_ERRNO_EREMOTE, __EREMOTE, ES("Too many levels of remote in path") }, { BSM_ERRNO_ENOLINK, #ifdef ENOLINK - ENOLINK, + __ENOLINK, #else ERRNO_NO_LOCAL_MAPPING, #endif @@ -303,7 +303,7 @@ ES("Communication error on send") }, { BSM_ERRNO_EPROTO, #ifdef EPROTO - EPROTO, + __EPROTO, #else ERRNO_NO_LOCAL_MAPPING, #endif @@ -324,20 +324,20 @@ ES("Facility is not active") }, { BSM_ERRNO_EMULTIHOP, #ifdef EMULTIHOP - EMULTIHOP, + __EMULTIHOP, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Multihop attempted") }, { BSM_ERRNO_EBADMSG, #ifdef EBADMSG - EBADMSG, + __EBADMSG, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Bad message") }, - { BSM_ERRNO_ENAMETOOLONG, ENAMETOOLONG, ES("File name too long") }, - { BSM_ERRNO_EOVERFLOW, EOVERFLOW, + { BSM_ERRNO_ENAMETOOLONG, __ENAMETOOLONG, ES("File name too long") }, + { BSM_ERRNO_EOVERFLOW, __EOVERFLOW, ES("Value too large to be stored in data type") }, { BSM_ERRNO_ENOTUNIQ, #ifdef ENOTUNIQ @@ -395,9 +395,9 @@ ERRNO_NO_LOCAL_MAPPING, #endif ES("Attempting to exec a shared library") }, - { BSM_ERRNO_EILSEQ, EILSEQ, ES("Illegal byte sequence") }, - { BSM_ERRNO_ENOSYS, ENOSYS, ES("Function not implemented") }, - { BSM_ERRNO_ELOOP, ELOOP, ES("Too many levels of symbolic links") }, + { BSM_ERRNO_EILSEQ, __EILSEQ, ES("Illegal byte sequence") }, + { BSM_ERRNO_ENOSYS, __ENOSYS, ES("Function not implemented") }, + { BSM_ERRNO_ELOOP, __ELOOP, ES("Too many levels of symbolic links") }, { BSM_ERRNO_ERESTART, #ifdef ERESTART ERESTART, @@ -412,122 +412,122 @@ ERRNO_NO_LOCAL_MAPPING, #endif ES("If pipe/FIFO, don't sleep in stream head") }, - { BSM_ERRNO_ENOTEMPTY, ENOTEMPTY, ES("Directory not empty") }, - { BSM_ERRNO_EUSERS, EUSERS, ES("Too many users") }, - { BSM_ERRNO_ENOTSOCK, ENOTSOCK, + { BSM_ERRNO_ENOTEMPTY, __ENOTEMPTY, ES("Directory not empty") }, + { BSM_ERRNO_EUSERS, __EUSERS, ES("Too many users") }, + { BSM_ERRNO_ENOTSOCK, __ENOTSOCK, ES("Socket operation on non-socket") }, - { BSM_ERRNO_EDESTADDRREQ, EDESTADDRREQ, + { BSM_ERRNO_EDESTADDRREQ, __EDESTADDRREQ, ES("Destination address required") }, - { BSM_ERRNO_EMSGSIZE, EMSGSIZE, ES("Message too long") }, - { BSM_ERRNO_EPROTOTYPE, EPROTOTYPE, + { BSM_ERRNO_EMSGSIZE, __EMSGSIZE, ES("Message too long") }, + { BSM_ERRNO_EPROTOTYPE, __EPROTOTYPE, ES("Protocol wrong type for socket") }, - { BSM_ERRNO_ENOPROTOOPT, ENOPROTOOPT, ES("Protocol not available") }, - { BSM_ERRNO_EPROTONOSUPPORT, EPROTONOSUPPORT, + { BSM_ERRNO_ENOPROTOOPT, __ENOPROTOOPT, ES("Protocol not available") }, + { BSM_ERRNO_EPROTONOSUPPORT, __EPROTONOSUPPORT, ES("Protocol not supported") }, - { BSM_ERRNO_ESOCKTNOSUPPORT, ESOCKTNOSUPPORT, + { BSM_ERRNO_ESOCKTNOSUPPORT, __ESOCKTNOSUPPORT, ES("Socket type not supported") }, - { BSM_ERRNO_EOPNOTSUPP, EOPNOTSUPP, ES("Operation not supported") }, - { BSM_ERRNO_EPFNOSUPPORT, EPFNOSUPPORT, + { BSM_ERRNO_EOPNOTSUPP, __EOPNOTSUPP, ES("Operation not supported") }, + { BSM_ERRNO_EPFNOSUPPORT, __EPFNOSUPPORT, ES("Protocol family not supported") }, - { BSM_ERRNO_EAFNOSUPPORT, EAFNOSUPPORT, + { BSM_ERRNO_EAFNOSUPPORT, __EAFNOSUPPORT, ES("Address family not supported by protocol family") }, - { BSM_ERRNO_EADDRINUSE, EADDRINUSE, ES("Address already in use") }, - { BSM_ERRNO_EADDRNOTAVAIL, EADDRNOTAVAIL, + { BSM_ERRNO_EADDRINUSE, __EADDRINUSE, ES("Address already in use") }, + { BSM_ERRNO_EADDRNOTAVAIL, __EADDRNOTAVAIL, ES("Can't assign requested address") }, - { BSM_ERRNO_ENETDOWN, ENETDOWN, ES("Network is down") }, - { BSM_ERRNO_ENETRESET, ENETRESET, + { BSM_ERRNO_ENETDOWN, __ENETDOWN, ES("Network is down") }, + { BSM_ERRNO_ENETRESET, __ENETRESET, ES("Network dropped connection on reset") }, - { BSM_ERRNO_ECONNABORTED, ECONNABORTED, + { BSM_ERRNO_ECONNABORTED, __ECONNABORTED, ES("Software caused connection abort") }, - { BSM_ERRNO_ECONNRESET, ECONNRESET, ES("Connection reset by peer") }, - { BSM_ERRNO_ENOBUFS, ENOBUFS, ES("No buffer space available") }, - { BSM_ERRNO_EISCONN, EISCONN, ES("Socket is already connected") }, - { BSM_ERRNO_ENOTCONN, ENOTCONN, ES("Socket is not connected") }, - { BSM_ERRNO_ESHUTDOWN, ESHUTDOWN, + { BSM_ERRNO_ECONNRESET, __ECONNRESET, ES("Connection reset by peer") }, + { BSM_ERRNO_ENOBUFS, __ENOBUFS, ES("No buffer space available") }, + { BSM_ERRNO_EISCONN, __EISCONN, ES("Socket is already connected") }, + { BSM_ERRNO_ENOTCONN, __ENOTCONN, ES("Socket is not connected") }, + { BSM_ERRNO_ESHUTDOWN, __ESHUTDOWN, ES("Can't send after socket shutdown") }, - { BSM_ERRNO_ETOOMANYREFS, ETOOMANYREFS, + { BSM_ERRNO_ETOOMANYREFS, __ETOOMANYREFS, ES("Too many references: can't splice") }, - { BSM_ERRNO_ETIMEDOUT, ETIMEDOUT, ES("Operation timed out") }, - { BSM_ERRNO_ECONNREFUSED, ECONNREFUSED, ES("Connection refused") }, - { BSM_ERRNO_EHOSTDOWN, EHOSTDOWN, ES("Host is down") }, - { BSM_ERRNO_EHOSTUNREACH, EHOSTUNREACH, ES("No route to host") }, - { BSM_ERRNO_EALREADY, EALREADY, ES("Operation already in progress") }, - { BSM_ERRNO_EINPROGRESS, EINPROGRESS, + { BSM_ERRNO_ETIMEDOUT, __ETIMEDOUT, ES("Operation timed out") }, + { BSM_ERRNO_ECONNREFUSED, __ECONNREFUSED, ES("Connection refused") }, + { BSM_ERRNO_EHOSTDOWN, __EHOSTDOWN, ES("Host is down") }, + { BSM_ERRNO_EHOSTUNREACH, __EHOSTUNREACH, ES("No route to host") }, + { BSM_ERRNO_EALREADY, __EALREADY, ES("Operation already in progress") }, + { BSM_ERRNO_EINPROGRESS, __EINPROGRESS, ES("Operation now in progress") }, - { BSM_ERRNO_ESTALE, ESTALE, ES("Stale NFS file handle") }, + { BSM_ERRNO_ESTALE, __ESTALE, ES("Stale NFS file handle") }, { BSM_ERRNO_EPROCLIM, #ifdef EPROCLIM - EPROCLIM, + __EPROCLIM, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Too many processes") }, { BSM_ERRNO_EBADRPC, #ifdef EBADRPC - EBADRPC, + __EBADRPC, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("RPC struct is bad") }, { BSM_ERRNO_ERPCMISMATCH, #ifdef ERPCMISMATCH - ERPCMISMATCH, + __ERPCMISMATCH, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("RPC version wrong") }, { BSM_ERRNO_EPROGUNAVAIL, #ifdef EPROGUNAVAIL - EPROGUNAVAIL, + __EPROGUNAVAIL, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("RPC prog. not avail") }, { BSM_ERRNO_EPROGMISMATCH, #ifdef EPROGMISMATCH - EPROGMISMATCH, + __EPROGMISMATCH, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("RPC version wrong") }, { BSM_ERRNO_EPROCUNAVAIL, #ifdef EPROCUNAVAIL - EPROCUNAVAIL, + __EPROCUNAVAIL, #else ERRNO_NO_LOCAL_MAPPING #endif ES("Bad procedure for program") }, { BSM_ERRNO_EFTYPE, #ifdef EFTYPE - EFTYPE, + __EFTYPE, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Inappropriate file type or format") }, { BSM_ERRNO_EAUTH, #ifdef EAUTH - EAUTH, + __EAUTH, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Authenticateion error") }, { BSM_ERRNO_ENEEDAUTH, #ifdef ENEEDAUTH - ENEEDAUTH, + __ENEEDAUTH, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Need authenticator") }, { BSM_ERRNO_ENOATTR, #ifdef ENOATTR - ENOATTR, + __ENOATTR, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Attribute not found") }, { BSM_ERRNO_EDOOFUS, #ifdef EDOOFUS - EDOOFUS, + __EDOOFUS, #else ERRNO_NO_LOCAL_MAPPING, #endif @@ -688,14 +688,14 @@ ES("Key was rejected by service") }, { BSM_ERRNO_ENOTCAPABLE, #ifdef ENOTCAPABLE - ENOTCAPABLE, + __ENOTCAPABLE, #else ERRNO_NO_LOCAL_MAPPING, #endif ES("Capabilities insufficient") }, { BSM_ERRNO_ECAPMODE, #ifdef ECAPMODE - ECAPMODE, + __ECAPMODE, #else ERRNO_NO_LOCAL_MAPPING, #endif Index: sys/amd64/conf/GENERIC =================================================================== --- sys/amd64/conf/GENERIC (revision 242394) +++ sys/amd64/conf/GENERIC (working copy) @@ -20,6 +20,7 @@ cpu HAMMER ident GENERIC +options TRACE_ERRORS makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support Index: sys/amd64/linux32/linux32_sysvec.c =================================================================== --- sys/amd64/linux32/linux32_sysvec.c (revision 242394) +++ sys/amd64/linux32/linux32_sysvec.c (working copy) @@ -137,7 +137,7 @@ * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h * linux-2.6.17.8/include/asm-generic/errno.h */ -static int bsd_to_linux_errno[ELAST + 1] = { +static int bsd_to_linux_errno[__ELAST + 1] = { -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, @@ -1028,7 +1028,7 @@ .sv_mask = 0, .sv_sigsize = LINUX_SIGTBLSZ, .sv_sigtbl = bsd_to_linux_signal, - .sv_errsize = ELAST + 1, + .sv_errsize = __ELAST + 1, .sv_errtbl = bsd_to_linux_errno, .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, Index: sys/amd64/amd64/genassym.c =================================================================== --- sys/amd64/amd64/genassym.c (revision 242394) +++ sys/amd64/amd64/genassym.c (working copy) @@ -206,9 +206,9 @@ ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler)); ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(UC_EFLAGS, offsetof(ucontext_t, uc_mcontext.mc_rflags)); -ASSYM(ENOENT, ENOENT); -ASSYM(EFAULT, EFAULT); -ASSYM(ENAMETOOLONG, ENAMETOOLONG); +ASSYM(ENOENT, __ENOENT); +ASSYM(EFAULT, __EFAULT); +ASSYM(ENAMETOOLONG, __ENAMETOOLONG); ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(MAXPATHLEN, MAXPATHLEN); ASSYM(PC_SIZEOF, sizeof(struct pcpu)); Index: sys/sys/errno.h =================================================================== --- sys/sys/errno.h (revision 242394) +++ sys/sys/errno.h (working copy) @@ -46,142 +46,349 @@ #define errno (* __error()) #endif -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* Input/output error */ -#define ENXIO 6 /* Device not configured */ -#define E2BIG 7 /* Argument list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file descriptor */ -#define ECHILD 10 /* No child processes */ -#define EDEADLK 11 /* Resource deadlock avoided */ +#define __EPERM 1 /* Operation not permitted */ +#define __ENOENT 2 /* No such file or directory */ +#define __ESRCH 3 /* No such process */ +#define __EINTR 4 /* Interrupted system call */ +#define __EIO 5 /* Input/output error */ +#define __ENXIO 6 /* Device not configured */ +#define __E2BIG 7 /* Argument list too long */ +#define __ENOEXEC 8 /* Exec format error */ +#define __EBADF 9 /* Bad file descriptor */ +#define __ECHILD 10 /* No child processes */ +#define __EDEADLK 11 /* Resource deadlock avoided */ /* 11 was EAGAIN */ -#define ENOMEM 12 /* Cannot allocate memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ +#define __ENOMEM 12 /* Cannot allocate memory */ +#define __EACCES 13 /* Permission denied */ +#define __EFAULT 14 /* Bad address */ #ifndef _POSIX_SOURCE -#define ENOTBLK 15 /* Block device required */ +#define __ENOTBLK 15 /* Block device required */ #endif -#define EBUSY 16 /* Device busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* Operation not supported by device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Inappropriate ioctl for device */ +#define __EBUSY 16 /* Device busy */ +#define __EEXIST 17 /* File exists */ +#define __EXDEV 18 /* Cross-device link */ +#define __ENODEV 19 /* Operation not supported by device */ +#define __ENOTDIR 20 /* Not a directory */ +#define __EISDIR 21 /* Is a directory */ +#define __EINVAL 22 /* Invalid argument */ +#define __ENFILE 23 /* Too many open files in system */ +#define __EMFILE 24 /* Too many open files */ +#define __ENOTTY 25 /* Inappropriate ioctl for device */ #ifndef _POSIX_SOURCE -#define ETXTBSY 26 /* Text file busy */ +#define __ETXTBSY 26 /* Text file busy */ #endif -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only filesystem */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ +#define __EFBIG 27 /* File too large */ +#define __ENOSPC 28 /* No space left on device */ +#define __ESPIPE 29 /* Illegal seek */ +#define __EROFS 30 /* Read-only filesystem */ +#define __EMLINK 31 /* Too many links */ +#define __EPIPE 32 /* Broken pipe */ /* math software */ -#define EDOM 33 /* Numerical argument out of domain */ -#define ERANGE 34 /* Result too large */ +#define __EDOM 33 /* Numerical argument out of domain */ +#define __ERANGE 34 /* Result too large */ /* non-blocking and interrupt i/o */ -#define EAGAIN 35 /* Resource temporarily unavailable */ +#define __EAGAIN 35 /* Resource temporarily unavailable */ #ifndef _POSIX_SOURCE -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define EINPROGRESS 36 /* Operation now in progress */ -#define EALREADY 37 /* Operation already in progress */ +#define __EWOULDBLOCK __EAGAIN /* Operation would block */ +#define __EINPROGRESS 36 /* Operation now in progress */ +#define __EALREADY 37 /* Operation already in progress */ /* ipc/network software -- argument errors */ -#define ENOTSOCK 38 /* Socket operation on non-socket */ -#define EDESTADDRREQ 39 /* Destination address required */ -#define EMSGSIZE 40 /* Message too long */ -#define EPROTOTYPE 41 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 42 /* Protocol not available */ -#define EPROTONOSUPPORT 43 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ -#define EOPNOTSUPP 45 /* Operation not supported */ -#define ENOTSUP EOPNOTSUPP /* Operation not supported */ -#define EPFNOSUPPORT 46 /* Protocol family not supported */ -#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ -#define EADDRINUSE 48 /* Address already in use */ -#define EADDRNOTAVAIL 49 /* Can't assign requested address */ +#define __ENOTSOCK 38 /* Socket operation on non-socket */ +#define __EDESTADDRREQ 39 /* Destination address required */ +#define __EMSGSIZE 40 /* Message too long */ +#define __EPROTOTYPE 41 /* Protocol wrong type for socket */ +#define __ENOPROTOOPT 42 /* Protocol not available */ +#define __EPROTONOSUPPORT 43 /* Protocol not supported */ +#define __ESOCKTNOSUPPORT 44 /* Socket type not supported */ +#define __EOPNOTSUPP 45 /* Operation not supported */ +#define __ENOTSUP __EOPNOTSUPP /* Operation not supported */ +#define __EPFNOSUPPORT 46 /* Protocol family not supported */ +#define __EAFNOSUPPORT 47 /* Address family not supported by protocol family */ +#define __EADDRINUSE 48 /* Address already in use */ +#define __EADDRNOTAVAIL 49 /* Can't assign requested address */ /* ipc/network software -- operational errors */ -#define ENETDOWN 50 /* Network is down */ -#define ENETUNREACH 51 /* Network is unreachable */ -#define ENETRESET 52 /* Network dropped connection on reset */ -#define ECONNABORTED 53 /* Software caused connection abort */ -#define ECONNRESET 54 /* Connection reset by peer */ -#define ENOBUFS 55 /* No buffer space available */ -#define EISCONN 56 /* Socket is already connected */ -#define ENOTCONN 57 /* Socket is not connected */ -#define ESHUTDOWN 58 /* Can't send after socket shutdown */ -#define ETOOMANYREFS 59 /* Too many references: can't splice */ -#define ETIMEDOUT 60 /* Operation timed out */ -#define ECONNREFUSED 61 /* Connection refused */ +#define __ENETDOWN 50 /* Network is down */ +#define __ENETUNREACH 51 /* Network is unreachable */ +#define __ENETRESET 52 /* Network dropped connection on reset */ +#define __ECONNABORTED 53 /* Software caused connection abort */ +#define __ECONNRESET 54 /* Connection reset by peer */ +#define __ENOBUFS 55 /* No buffer space available */ +#define __EISCONN 56 /* Socket is already connected */ +#define __ENOTCONN 57 /* Socket is not connected */ +#define __ESHUTDOWN 58 /* Can't send after socket shutdown */ +#define __ETOOMANYREFS 59 /* Too many references: can't splice */ +#define __ETIMEDOUT 60 /* Operation timed out */ +#define __ECONNREFUSED 61 /* Connection refused */ -#define ELOOP 62 /* Too many levels of symbolic links */ +#define __ELOOP 62 /* Too many levels of symbolic links */ #endif /* _POSIX_SOURCE */ -#define ENAMETOOLONG 63 /* File name too long */ +#define __ENAMETOOLONG 63 /* File name too long */ /* should be rearranged */ #ifndef _POSIX_SOURCE -#define EHOSTDOWN 64 /* Host is down */ -#define EHOSTUNREACH 65 /* No route to host */ +#define __EHOSTDOWN 64 /* Host is down */ +#define __EHOSTUNREACH 65 /* No route to host */ #endif /* _POSIX_SOURCE */ -#define ENOTEMPTY 66 /* Directory not empty */ +#define __ENOTEMPTY 66 /* Directory not empty */ /* quotas & mush */ #ifndef _POSIX_SOURCE -#define EPROCLIM 67 /* Too many processes */ -#define EUSERS 68 /* Too many users */ -#define EDQUOT 69 /* Disc quota exceeded */ +#define __EPROCLIM 67 /* Too many processes */ +#define __EUSERS 68 /* Too many users */ +#define __EDQUOT 69 /* Disc quota exceeded */ /* Network File System */ -#define ESTALE 70 /* Stale NFS file handle */ -#define EREMOTE 71 /* Too many levels of remote in path */ -#define EBADRPC 72 /* RPC struct is bad */ -#define ERPCMISMATCH 73 /* RPC version wrong */ -#define EPROGUNAVAIL 74 /* RPC prog. not avail */ -#define EPROGMISMATCH 75 /* Program version wrong */ -#define EPROCUNAVAIL 76 /* Bad procedure for program */ +#define __ESTALE 70 /* Stale NFS file handle */ +#define __EREMOTE 71 /* Too many levels of remote in path */ +#define __EBADRPC 72 /* RPC struct is bad */ +#define __ERPCMISMATCH 73 /* RPC version wrong */ +#define __EPROGUNAVAIL 74 /* RPC prog. not avail */ +#define __EPROGMISMATCH 75 /* Program version wrong */ +#define __EPROCUNAVAIL 76 /* Bad procedure for program */ #endif /* _POSIX_SOURCE */ -#define ENOLCK 77 /* No locks available */ -#define ENOSYS 78 /* Function not implemented */ +#define __ENOLCK 77 /* No locks available */ +#define __ENOSYS 78 /* Function not implemented */ #ifndef _POSIX_SOURCE -#define EFTYPE 79 /* Inappropriate file type or format */ -#define EAUTH 80 /* Authentication error */ -#define ENEEDAUTH 81 /* Need authenticator */ -#define EIDRM 82 /* Identifier removed */ -#define ENOMSG 83 /* No message of desired type */ -#define EOVERFLOW 84 /* Value too large to be stored in data type */ -#define ECANCELED 85 /* Operation canceled */ -#define EILSEQ 86 /* Illegal byte sequence */ -#define ENOATTR 87 /* Attribute not found */ +#define __EFTYPE 79 /* Inappropriate file type or format */ +#define __EAUTH 80 /* Authentication error */ +#define __ENEEDAUTH 81 /* Need authenticator */ +#define __EIDRM 82 /* Identifier removed */ +#define __ENOMSG 83 /* No message of desired type */ +#define __EOVERFLOW 84 /* Value too large to be stored in data type */ +#define __ECANCELED 85 /* Operation canceled */ +#define __EILSEQ 86 /* Illegal byte sequence */ +#define __ENOATTR 87 /* Attribute not found */ -#define EDOOFUS 88 /* Programming error */ +#define __EDOOFUS 88 /* Programming error */ #endif /* _POSIX_SOURCE */ -#define EBADMSG 89 /* Bad message */ -#define EMULTIHOP 90 /* Multihop attempted */ -#define ENOLINK 91 /* Link has been severed */ -#define EPROTO 92 /* Protocol error */ +#define __EBADMSG 89 /* Bad message */ +#define __EMULTIHOP 90 /* Multihop attempted */ +#define __ENOLINK 91 /* Link has been severed */ +#define __EPROTO 92 /* Protocol error */ #ifndef _POSIX_SOURCE -#define ENOTCAPABLE 93 /* Capabilities insufficient */ -#define ECAPMODE 94 /* Not permitted in capability mode */ +#define __ENOTCAPABLE 93 /* Capabilities insufficient */ +#define __ECAPMODE 94 /* Not permitted in capability mode */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 94 /* Must be equal largest errno */ +#define __ELAST 94 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ +#if (defined(_KERNEL) && defined(TRACE_ERRORS)) +int __kern_trace_error(const int, const char *, const int); +#define EPERM __kern_trace_error(__EPERM, __FILE__, __LINE__) +#define ENOENT __kern_trace_error(__ENOENT, __FILE__, __LINE__) +#define ESRCH __kern_trace_error(__ESRCH, __FILE__, __LINE__) +#define EINTR __kern_trace_error(__EINTR, __FILE__, __LINE__) +#define EIO __kern_trace_error(__EIO, __FILE__, __LINE__) +#define ENXIO __kern_trace_error(__ENXIO, __FILE__, __LINE__) +#define E2BIG __kern_trace_error(__E2BIG, __FILE__, __LINE__) +#define ENOEXEC __kern_trace_error(__ENOEXEC, __FILE__, __LINE__) +#define EBADF __kern_trace_error(__EBADF, __FILE__, __LINE__) +#define ECHILD __kern_trace_error(__ECHILD, __FILE__, __LINE__) +#define EDEADLK __kern_trace_error(__EDEADLK, __FILE__, __LINE__) +#define ENOMEM __kern_trace_error(__ENOMEM, __FILE__, __LINE__) +#define EACCES __kern_trace_error(__EACCES, __FILE__, __LINE__) +#define EFAULT __kern_trace_error(__EFAULT, __FILE__, __LINE__) +#define EBUSY __kern_trace_error(__EBUSY, __FILE__, __LINE__) +#define EEXIST __kern_trace_error(__EEXIST, __FILE__, __LINE__) +#define EXDEV __kern_trace_error(__EXDEV, __FILE__, __LINE__) +#define ENODEV __kern_trace_error(__ENODEV, __FILE__, __LINE__) +#define ENOTDIR __kern_trace_error(__ENOTDIR, __FILE__, __LINE__) +#define EISDIR __kern_trace_error(__EISDIR, __FILE__, __LINE__) +#define EINVAL __kern_trace_error(__EINVAL, __FILE__, __LINE__) +#define ENFILE __kern_trace_error(__ENFILE, __FILE__, __LINE__) +#define EMFILE __kern_trace_error(__EMFILE, __FILE__, __LINE__) +#define ENOTTY __kern_trace_error(__ENOTTY, __FILE__, __LINE__) +#define EFBIG __kern_trace_error(__EFBIG, __FILE__, __LINE__) +#define ENOSPC __kern_trace_error(__ENOSPC, __FILE__, __LINE__) +#define ESPIPE __kern_trace_error(__ESPIPE, __FILE__, __LINE__) +#define EROFS __kern_trace_error(__EROFS, __FILE__, __LINE__) +#define EMLINK __kern_trace_error(__EMLINK, __FILE__, __LINE__) +#define EPIPE __kern_trace_error(__EPIPE, __FILE__, __LINE__) +#define EDOM __kern_trace_error(__EDOM, __FILE__, __LINE__) +#define ERANGE __kern_trace_error(__ERANGE, __FILE__, __LINE__) +#define EAGAIN __kern_trace_error(__EAGAIN, __FILE__, __LINE__) +#define ENAMETOOLONG __kern_trace_error(__ENAMETOOLONG, __FILE__, __LINE__) +#define ENOTEMPTY __kern_trace_error(__ENOTEMPTY, __FILE__, __LINE__) +#define ENOLCK __kern_trace_error(__ENOLCK, __FILE__, __LINE__) +#define ENOSYS __kern_trace_error(__ENOSYS, __FILE__, __LINE__) +#define EBADMSG __kern_trace_error(__EBADMSG, __FILE__, __LINE__) +#define EMULTIHOP __kern_trace_error(__EMULTIHOP, __FILE__, __LINE__) +#define ENOLINK __kern_trace_error(__ENOLINK, __FILE__, __LINE__) +#define EPROTO __kern_trace_error(__EPROTO, __FILE__, __LINE__) + +#ifndef _POSIX_SOURCE +#define ENOTBLK __kern_trace_error(__ENOTBLK, __FILE__, __LINE__) +#define ETXTBSY __kern_trace_error(__ETXTBSY, __FILE__, __LINE__) +#define EWOULDBLOCK __kern_trace_error(__EWOULDBLOCK, __FILE__, __LINE__) +#define EINPROGRESS __kern_trace_error(__EINPROGRESS, __FILE__, __LINE__) +#define EALREADY __kern_trace_error(__EALREADY, __FILE__, __LINE__) +#define ENOTSOCK __kern_trace_error(__ENOTSOCK, __FILE__, __LINE__) +#define EDESTADDRREQ __kern_trace_error(__EDESTADDRREQ, __FILE__, __LINE__) +#define EMSGSIZE __kern_trace_error(__EMSGSIZE, __FILE__, __LINE__) +#define EPROTOTYPE __kern_trace_error(__EPROTOTYPE, __FILE__, __LINE__) +#define ENOPROTOOPT __kern_trace_error(__ENOPROTOOPT, __FILE__, __LINE__) +#define EPROTONOSUPPORT __kern_trace_error(__EPROTONOSUPPORT, __FILE__, __LINE__) +#define ESOCKTNOSUPPORT __kern_trace_error(__ESOCKTNOSUPPORT, __FILE__, __LINE__) +#define EOPNOTSUPP __kern_trace_error(__EOPNOTSUPP, __FILE__, __LINE__) +#define ENOTSUP __kern_trace_error(__ENOTSUP, __FILE__, __LINE__) +#define EPFNOSUPPORT __kern_trace_error(__EPFNOSUPPORT, __FILE__, __LINE__) +#define EAFNOSUPPORT __kern_trace_error(__EAFNOSUPPORT, __FILE__, __LINE__) +#define EADDRINUSE __kern_trace_error(__EADDRINUSE, __FILE__, __LINE__) +#define EADDRNOTAVAIL __kern_trace_error(__EADDRNOTAVAIL, __FILE__, __LINE__) +#define ENETDOWN __kern_trace_error(__ENETDOWN, __FILE__, __LINE__) +#define ENETUNREACH __kern_trace_error(__ENETUNREACH, __FILE__, __LINE__) +#define ENETRESET __kern_trace_error(__ENETRESET, __FILE__, __LINE__) +#define ECONNABORTED __kern_trace_error(__ECONNABORTED, __FILE__, __LINE__) +#define ECONNRESET __kern_trace_error(__ECONNRESET, __FILE__, __LINE__) +#define ENOBUFS __kern_trace_error(__ENOBUFS, __FILE__, __LINE__) +#define EISCONN __kern_trace_error(__EISCONN, __FILE__, __LINE__) +#define ENOTCONN __kern_trace_error(__ENOTCONN, __FILE__, __LINE__) +#define ESHUTDOWN __kern_trace_error(__ESHUTDOWN, __FILE__, __LINE__) +#define ETOOMANYREFS __kern_trace_error(__ETOOMANYREFS, __FILE__, __LINE__) +#define ETIMEDOUT __kern_trace_error(__ETIMEDOUT, __FILE__, __LINE__) +#define ECONNREFUSED __kern_trace_error(__ECONNREFUSED, __FILE__, __LINE__) +#define ELOOP __kern_trace_error(__ELOOP, __FILE__, __LINE__) +#define EHOSTDOWN __kern_trace_error(__EHOSTDOWN, __FILE__, __LINE__) +#define EHOSTUNREACH __kern_trace_error(__EHOSTUNREACH, __FILE__, __LINE__) +#define EPROCLIM __kern_trace_error(__EPROCLIM, __FILE__, __LINE__) +#define EUSERS __kern_trace_error(__EUSERS, __FILE__, __LINE__) +#define EDQUOT __kern_trace_error(__EDQUOT, __FILE__, __LINE__) +#define ESTALE __kern_trace_error(__ESTALE, __FILE__, __LINE__) +#define EREMOTE __kern_trace_error(__EREMOTE, __FILE__, __LINE__) +#define EBADRPC __kern_trace_error(__EBADRPC, __FILE__, __LINE__) +#define ERPCMISMATCH __kern_trace_error(__ERPCMISMATCH, __FILE__, __LINE__) +#define EPROGUNAVAIL __kern_trace_error(__EPROGUNAVAIL, __FILE__, __LINE__) +#define EPROGMISMATCH __kern_trace_error(__EPROGMISMATCH, __FILE__, __LINE__) +#define EPROCUNAVAIL __kern_trace_error(__EPROCUNAVAIL, __FILE__, __LINE__) +#define EFTYPE __kern_trace_error(__EFTYPE, __FILE__, __LINE__) +#define EAUTH __kern_trace_error(__EAUTH, __FILE__, __LINE__) +#define ENEEDAUTH __kern_trace_error(__ENEEDAUTH, __FILE__, __LINE__) +#define EIDRM __kern_trace_error(__EIDRM, __FILE__, __LINE__) +#define ENOMSG __kern_trace_error(__ENOMSG, __FILE__, __LINE__) +#define EOVERFLOW __kern_trace_error(__EOVERFLOW, __FILE__, __LINE__) +#define ECANCELED __kern_trace_error(__ECANCELED, __FILE__, __LINE__) +#define EILSEQ __kern_trace_error(__EILSEQ, __FILE__, __LINE__) +#define ENOATTR __kern_trace_error(__ENOATTR, __FILE__, __LINE__) +#define EDOOFUS __kern_trace_error(__EDOOFUS, __FILE__, __LINE__) +#define ENOTCAPABLE __kern_trace_error(__ENOTCAPABLE, __FILE__, __LINE__) +#define ECAPMODE __kern_trace_error(__ECAPMODE, __FILE__, __LINE__) +#define ELAST __kern_trace_error(__ELAST, __FILE__, __LINE__) +#endif /* _POSIX_SOURCE */ + +#else /* ! (_KERNEL && TRACE_ERRORS) */ + +#define EPERM __EPERM +#define ENOENT __ENOENT +#define ESRCH __ESRCH +#define EINTR __EINTR +#define EIO __EIO +#define ENXIO __ENXIO +#define E2BIG __E2BIG +#define ENOEXEC __ENOEXEC +#define EBADF __EBADF +#define ECHILD __ECHILD +#define EDEADLK __EDEADLK +#define ENOMEM __ENOMEM +#define EACCES __EACCES +#define EFAULT __EFAULT +#define EBUSY __EBUSY +#define EEXIST __EEXIST +#define EXDEV __EXDEV +#define ENODEV __ENODEV +#define ENOTDIR __ENOTDIR +#define EISDIR __EISDIR +#define EINVAL __EINVAL +#define ENFILE __ENFILE +#define EMFILE __EMFILE +#define ENOTTY __ENOTTY +#define EFBIG __EFBIG +#define ENOSPC __ENOSPC +#define ESPIPE __ESPIPE +#define EROFS __EROFS +#define EMLINK __EMLINK +#define EPIPE __EPIPE +#define EDOM __EDOM +#define ERANGE __ERANGE +#define EAGAIN __EAGAIN +#define ENAMETOOLONG __ENAMETOOLONG +#define ENOTEMPTY __ENOTEMPTY +#define ENOLCK __ENOLCK +#define ENOSYS __ENOSYS +#define EBADMSG __EBADMSG +#define EMULTIHOP __EMULTIHOP +#define ENOLINK __ENOLINK +#define EPROTO __EPROTO + +#ifndef _POSIX_SOURCE +#define ENOTBLK __ENOTBLK +#define ETXTBSY __ETXTBSY +#define EWOULDBLOCK __EWOULDBLOCK +#define EINPROGRESS __EINPROGRESS +#define EALREADY __EALREADY +#define ENOTSOCK __ENOTSOCK +#define EDESTADDRREQ __EDESTADDRREQ +#define EMSGSIZE __EMSGSIZE +#define EPROTOTYPE __EPROTOTYPE +#define ENOPROTOOPT __ENOPROTOOPT +#define EPROTONOSUPPORT __EPROTONOSUPPORT +#define ESOCKTNOSUPPORT __ESOCKTNOSUPPORT +#define EOPNOTSUPP __EOPNOTSUPP +#define ENOTSUP __ENOTSUP +#define EPFNOSUPPORT __EPFNOSUPPORT +#define EAFNOSUPPORT __EAFNOSUPPORT +#define EADDRINUSE __EADDRINUSE +#define EADDRNOTAVAIL __EADDRNOTAVAIL +#define ENETDOWN __ENETDOWN +#define ENETUNREACH __ENETUNREACH +#define ENETRESET __ENETRESET +#define ECONNABORTED __ECONNABORTED +#define ECONNRESET __ECONNRESET +#define ENOBUFS __ENOBUFS +#define EISCONN __EISCONN +#define ENOTCONN __ENOTCONN +#define ESHUTDOWN __ESHUTDOWN +#define ETOOMANYREFS __ETOOMANYREFS +#define ETIMEDOUT __ETIMEDOUT +#define ECONNREFUSED __ECONNREFUSED +#define ELOOP __ELOOP +#define EHOSTDOWN __EHOSTDOWN +#define EHOSTUNREACH __EHOSTUNREACH +#define EPROCLIM __EPROCLIM +#define EUSERS __EUSERS +#define EDQUOT __EDQUOT +#define ESTALE __ESTALE +#define EREMOTE __EREMOTE +#define EBADRPC __EBADRPC +#define ERPCMISMATCH __ERPCMISMATCH +#define EPROGUNAVAIL __EPROGUNAVAIL +#define EPROGMISMATCH __EPROGMISMATCH +#define EPROCUNAVAIL __EPROCUNAVAIL +#define EFTYPE __EFTYPE +#define EAUTH __EAUTH +#define ENEEDAUTH __ENEEDAUTH +#define EIDRM __EIDRM +#define ENOMSG __ENOMSG +#define EOVERFLOW __EOVERFLOW +#define ECANCELED __ECANCELED +#define EILSEQ __EILSEQ +#define ENOATTR __ENOATTR +#define EDOOFUS __EDOOFUS +#define ENOTCAPABLE __ENOTCAPABLE +#define ECAPMODE __ECAPMODE +#define ELAST __ELAST +#endif /* _POSIX_SOURCE */ +#endif /* _KERNEL && TRACE_ERRORS */ + #ifdef _KERNEL /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ @@ -190,4 +397,4 @@ #define EDIRIOCTL (-4) /* do direct ioctl in GEOM */ #endif -#endif +#endif /* _SYS_ERRNO_H_ */ Index: sys/rpc/clnt_vc.c =================================================================== --- sys/rpc/clnt_vc.c (revision 242394) +++ sys/rpc/clnt_vc.c (working copy) @@ -506,11 +506,11 @@ */ errp->re_errno = error; switch (error) { - case EINTR: + case __EINTR: case ERESTART: stat = RPC_INTR; break; - case EWOULDBLOCK: + case __EWOULDBLOCK: stat = RPC_TIMEDOUT; break; default: Index: sys/conf/files =================================================================== --- sys/conf/files (revision 242394) +++ sys/conf/files (working copy) @@ -2598,6 +2598,7 @@ kern/kern_descrip.c standard kern/kern_dtrace.c optional kdtrace_hooks kern/kern_environment.c standard +kern/kern_error.c optional trace_errors kern/kern_et.c standard kern/kern_event.c standard kern/kern_exec.c standard Index: sys/conf/options =================================================================== --- sys/conf/options (revision 242394) +++ sys/conf/options (working copy) @@ -580,6 +580,7 @@ RWLOCK_NOINLINE opt_global.h SX_NOINLINE opt_global.h VFS_BIO_DEBUG opt_global.h +TRACE_ERRORS opt_global.h # These are VM related options VM_KMEM_SIZE opt_vm.h Index: sys/conf/NOTES =================================================================== --- sys/conf/NOTES (revision 242394) +++ sys/conf/NOTES (working copy) @@ -487,6 +487,12 @@ options INVARIANT_SUPPORT # +# The TRACE_ERRORS option makes it possible to log(9) a place where a +# specific error occured, and optionally print a backtrace. +# +options TRACE_ERRORS + +# # The DIAGNOSTIC option is used to enable extra debugging information # from some parts of the kernel. As this makes everything more noisy, # it is disabled by default. Index: sys/ufs/ufs/ufs_vnops.c =================================================================== --- sys/ufs/ufs/ufs_vnops.c (revision 242394) +++ sys/ufs/ufs/ufs_vnops.c (working copy) @@ -1632,7 +1632,7 @@ } /* FALLTHROUGH */ - case EOPNOTSUPP: + case __EOPNOTSUPP: /* * Just use the mode as-is. */ @@ -1656,7 +1656,7 @@ case 0: break; - case EOPNOTSUPP: + case __EOPNOTSUPP: /* * XXX: This should not happen, as EOPNOTSUPP above * was supposed to free acl. @@ -1714,7 +1714,7 @@ } /* FALLTHROUGH */ - case EOPNOTSUPP: + case __EOPNOTSUPP: /* * Just use the mode as-is. */ @@ -1736,7 +1736,7 @@ case 0: break; - case EOPNOTSUPP: + case __EOPNOTSUPP: /* * XXX: This should not happen, as EOPNOTSUPP above was * supposed to free acl. Index: sys/ufs/ufs/ufs_lookup.c =================================================================== --- sys/ufs/ufs/ufs_lookup.c (revision 242394) +++ sys/ufs/ufs/ufs_lookup.c (working copy) @@ -318,7 +318,7 @@ ep = (struct direct *)((char *)bp->b_data + (i_offset & bmask)); goto foundentry; - case ENOENT: + case __ENOENT: i_offset = roundup2(dp->i_size, DIRBLKSIZ); goto notfound; default: Index: sys/ufs/ufs/ufs_acl.c =================================================================== --- sys/ufs/ufs/ufs_acl.c (revision 242394) +++ sys/ufs/ufs/ufs_acl.c (working copy) @@ -297,9 +297,9 @@ switch (error) { /* * XXX: If ufs_getacl() should work on filesystems - * without the EA configured, add case EOPNOTSUPP here. + * without the EA configured, add case __EOPNOTSUPP here. */ - case ENOATTR: + case __ENOATTR: switch (ap->a_type) { case ACL_TYPE_ACCESS: /* Index: sys/kern/vfs_vnops.c =================================================================== --- sys/kern/vfs_vnops.c (revision 242394) +++ sys/kern/vfs_vnops.c (working copy) @@ -1886,7 +1886,7 @@ struct vattr va; daddr_t bn, bnp; uint64_t bsize; - off_t noff; + off_t noff = 0; int error; KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, Index: sys/kern/sys_generic.c =================================================================== --- sys/kern/sys_generic.c (revision 242394) +++ sys/kern/sys_generic.c (working copy) @@ -1169,7 +1169,7 @@ struct seltd *stp; struct selfd *sfp; struct selfd *sfn; - struct file *fp; + struct file *fp = NULL; fd_mask bit; int fd, ev, n, idx; int error; @@ -1210,7 +1210,7 @@ int nfd; { struct filedesc *fdp; - struct file *fp; + struct file *fp = NULL; fd_mask bit; int ev, flags, end, fd; int n, idx; Index: sys/kern/kern_descrip.c =================================================================== --- sys/kern/kern_descrip.c (revision 242394) +++ sys/kern/kern_descrip.c (working copy) @@ -2631,7 +2631,7 @@ * (indx). (dfd) is effectively closed by this operation. */ switch (openerror) { - case ENODEV: + case __ENODEV: /* * Check that the mode the file is being opened for is a * subset of the mode of the existing descriptor. @@ -2645,7 +2645,7 @@ fdp->fd_ofileflags[indx] = fdp->fd_ofileflags[dfd]; fhold(fp); break; - case ENXIO: + case __ENXIO: /* * Steal away the file pointer from dfd and stuff it into indx. */ Index: sys/kern/subr_sbuf.c =================================================================== --- sys/kern/subr_sbuf.c (revision 242394) +++ sys/kern/subr_sbuf.c (working copy) @@ -486,7 +486,7 @@ len = SBUF_FREESPACE(s); } switch (copyinstr(uaddr, s->s_buf + s->s_len, len + 1, &done)) { - case ENAMETOOLONG: + case __ENAMETOOLONG: s->s_error = ENOMEM; /* fall through */ case 0: Index: sys/kern/kern_linker.c =================================================================== --- sys/kern/kern_linker.c (revision 242394) +++ sys/kern/kern_linker.c (working copy) @@ -1994,7 +1994,7 @@ struct linker_file *parent, struct mod_depend *verinfo, struct linker_file **lfpp) { - linker_file_t lfdep; + linker_file_t lfdep = NULL; const char *filename; char *pathname; int error; Index: sys/ofed/include/linux/linux_idr.c =================================================================== --- sys/ofed/include/linux/linux_idr.c (revision 242394) +++ sys/ofed/include/linux/linux_idr.c (working copy) @@ -271,7 +271,7 @@ int error; int layer; int idx; - int id; + int id = 0; error = -EAGAIN; mtx_lock(&idr->lock); @@ -347,7 +347,7 @@ int error; int layer; int idx, sidx; - int id; + int id = 0; error = -EAGAIN; mtx_lock(&idr->lock); Index: sys/ofed/drivers/infiniband/core/addr.c =================================================================== --- sys/ofed/drivers/infiniband/core/addr.c (revision 242394) +++ sys/ofed/drivers/infiniband/core/addr.c (working copy) @@ -569,7 +569,7 @@ req->timeout = jiffies; queue_req(req); break; - case -ENODATA: + case -__ECONNREFUSED: req->timeout = msecs_to_jiffies(timeout_ms) + jiffies; queue_req(req); break; Index: sys/ofed/drivers/infiniband/core/cma.c =================================================================== --- sys/ofed/drivers/infiniband/core/cma.c (revision 242394) +++ sys/ofed/drivers/infiniband/core/cma.c (working copy) @@ -1316,11 +1316,11 @@ case 0: event.event = RDMA_CM_EVENT_ESTABLISHED; break; - case -ECONNRESET: - case -ECONNREFUSED: + case -__ECONNRESET: + case -__ECONNREFUSED: event.event = RDMA_CM_EVENT_REJECTED; break; - case -ETIMEDOUT: + case -__ETIMEDOUT: event.event = RDMA_CM_EVENT_UNREACHABLE; break; default: Index: sys/ofed/drivers/net/mlx4/cmd.c =================================================================== --- sys/ofed/drivers/net/mlx4/cmd.c (revision 242394) +++ sys/ofed/drivers/net/mlx4/cmd.c (working copy) @@ -114,24 +114,24 @@ static int mlx4_status_to_errno(u8 status) { static const int trans_table[] = { - [CMD_STAT_INTERNAL_ERR] = -EIO, - [CMD_STAT_BAD_OP] = -EPERM, - [CMD_STAT_BAD_PARAM] = -EINVAL, - [CMD_STAT_BAD_SYS_STATE] = -ENXIO, - [CMD_STAT_BAD_RESOURCE] = -EBADF, - [CMD_STAT_RESOURCE_BUSY] = -EBUSY, - [CMD_STAT_EXCEED_LIM] = -ENOMEM, - [CMD_STAT_BAD_RES_STATE] = -EBADF, - [CMD_STAT_BAD_INDEX] = -EBADF, - [CMD_STAT_BAD_NVMEM] = -EFAULT, - [CMD_STAT_ICM_ERROR] = -ENFILE, - [CMD_STAT_BAD_QP_STATE] = -EINVAL, - [CMD_STAT_BAD_SEG_PARAM] = -EFAULT, - [CMD_STAT_REG_BOUND] = -EBUSY, - [CMD_STAT_LAM_NOT_PRE] = -EAGAIN, - [CMD_STAT_BAD_PKT] = -EINVAL, - [CMD_STAT_BAD_SIZE] = -ENOMEM, - [CMD_STAT_MULTI_FUNC_REQ] = -EACCES, + [CMD_STAT_INTERNAL_ERR] = -__EIO, + [CMD_STAT_BAD_OP] = -__EPERM, + [CMD_STAT_BAD_PARAM] = -__EINVAL, + [CMD_STAT_BAD_SYS_STATE] = -__ENXIO, + [CMD_STAT_BAD_RESOURCE] = -__EBADF, + [CMD_STAT_RESOURCE_BUSY] = -__EBUSY, + [CMD_STAT_EXCEED_LIM] = -__ENOMEM, + [CMD_STAT_BAD_RES_STATE] = -__EBADF, + [CMD_STAT_BAD_INDEX] = -__EBADF, + [CMD_STAT_BAD_NVMEM] = -__EFAULT, + [CMD_STAT_ICM_ERROR] = -__ENFILE, + [CMD_STAT_BAD_QP_STATE] = -__EINVAL, + [CMD_STAT_BAD_SEG_PARAM] = -__EFAULT, + [CMD_STAT_REG_BOUND] = -__EBUSY, + [CMD_STAT_LAM_NOT_PRE] = -__EAGAIN, + [CMD_STAT_BAD_PKT] = -__EINVAL, + [CMD_STAT_BAD_SIZE] = -__ENOMEM, + [CMD_STAT_MULTI_FUNC_REQ] = -__EACCES, }; if (status >= ARRAY_SIZE(trans_table) || Index: sys/dev/if_ndis/if_ndis.c =================================================================== --- sys/dev/if_ndis/if_ndis.c (revision 242394) +++ sys/dev/if_ndis/if_ndis.c (working copy) @@ -2679,7 +2679,7 @@ struct ieee80211com *ic; struct ieee80211vap *vap; struct ieee80211_node *ni; - ndis_wlan_bssid_ex *bs; + ndis_wlan_bssid_ex *bs = NULL; int rval, len, i = 0; int chanflag; uint32_t arg; Index: sys/dev/dpt/dpt_scsi.c =================================================================== --- sys/dev/dpt/dpt_scsi.c (revision 242394) +++ sys/dev/dpt/dpt_scsi.c (working copy) @@ -2457,7 +2457,7 @@ case 0: /* Wakeup call received */ break; - case EWOULDBLOCK: + case __EWOULDBLOCK: /* Timer Expired */ break; default: Index: sys/dev/le/if_le_isa.c =================================================================== --- sys/dev/le/if_le_isa.c (revision 242394) +++ sys/dev/le/if_le_isa.c (working copy) @@ -247,7 +247,7 @@ switch (ISA_PNP_PROBE(device_get_parent(dev), dev, le_isa_ids)) { case 0: return (BUS_PROBE_DEFAULT); - case ENOENT: + case __ENOENT: for (i = 0; i < sizeof(le_isa_params) / sizeof(le_isa_params[0]); i++) { if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { @@ -256,7 +256,7 @@ } } /* FALLTHROUGH */ - case ENXIO: + case __ENXIO: default: return (ENXIO); } @@ -285,7 +285,7 @@ macstart = 0; macstride = 1; break; - case ENOENT: + case __ENOENT: for (i = 0; i < sizeof(le_isa_params) / sizeof(le_isa_params[0]); i++) { if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) { @@ -300,7 +300,7 @@ } } /* FALLTHROUGH */ - case ENXIO: + case __ENXIO: default: device_printf(dev, "cannot determine chip\n"); error = ENXIO; Index: sys/dev/streams/streams.c =================================================================== --- sys/dev/streams/streams.c (revision 242394) +++ sys/dev/streams/streams.c (working copy) @@ -310,8 +310,8 @@ error = kern_open(td, ptyname, UIO_SYSSPACE, O_RDWR, 0); switch (error) { - case ENOENT: - case ENXIO: + case __ENOENT: + case __ENXIO: return error; case 0: td->td_dupfd = td->td_retval[0]; Index: sys/dev/cxgbe/tom/t4_ddp.c =================================================================== --- sys/dev/cxgbe/tom/t4_ddp.c (revision 242394) +++ sys/dev/cxgbe/tom/t4_ddp.c (working copy) @@ -852,8 +852,8 @@ struct tcpcb *tp = so_sototcpcb(so); struct toepcb *toep = tp->t_toe; struct adapter *sc = td_adapter(toep->td); - vm_page_t *pages; - int npages, db_idx, rc, buf_flag; + vm_page_t *pages = NULL; + int npages = 0, db_idx, rc, buf_flag; struct ddp_buffer *db; struct wrqe *wr; uint64_t ddp_flags; Index: sys/dev/cxgbe/t4_main.c =================================================================== --- sys/dev/cxgbe/t4_main.c (revision 242394) +++ sys/dev/cxgbe/t4_main.c (working copy) @@ -1765,7 +1765,7 @@ { int rc; struct fw_caps_config_cmd caps; - uint32_t mtype, maddr, finicsum, cfcsum; + uint32_t mtype = 0, maddr = 0, finicsum, cfcsum; rc = cfg ? upload_config_file(sc, cfg, &mtype, &maddr) : ENOENT; if (rc != 0) { Index: sys/dev/fatm/if_fatm.c =================================================================== --- sys/dev/fatm/if_fatm.c (revision 242394) +++ sys/dev/fatm/if_fatm.c (working copy) @@ -202,7 +202,7 @@ switch(error) { - case EWOULDBLOCK: + case __EWOULDBLOCK: error = EIO; break; @@ -292,7 +292,7 @@ switch(error) { - case EWOULDBLOCK: + case __EWOULDBLOCK: error = EIO; break; @@ -1728,7 +1728,7 @@ switch (error) { - case EWOULDBLOCK: + case __EWOULDBLOCK: error = EIO; break; Index: sys/dev/sfxge/common/siena_nic.c =================================================================== --- sys/dev/sfxge/common/siena_nic.c (revision 242394) +++ sys/dev/sfxge/common/siena_nic.c (working copy) @@ -586,7 +586,7 @@ efx_port_t *epp = &(enp->en_port); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); siena_link_state_t sls; - unsigned int mask; + unsigned int mask = 0; int rc; EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); Index: sys/dev/iscsi/initiator/isc_sm.c =================================================================== --- sys/dev/iscsi/initiator/isc_sm.c (revision 242394) +++ sys/dev/iscsi/initiator/isc_sm.c (working copy) @@ -498,10 +498,10 @@ error, bhs->opcode, pq->ccb, ntohl(bhs->itt)); i_remove_hld(sp, pq); switch(error) { - case EPIPE: + case __EPIPE: sp->flags &= ~ISC_LINK_UP; - case EAGAIN: + case __EAGAIN: xdebug("requed"); i_rqueue_pdu(sp, pq); break; Index: sys/dev/esp/ncr53c9x.c =================================================================== --- sys/dev/esp/ncr53c9x.c (revision 242394) +++ sys/dev/esp/ncr53c9x.c (working copy) @@ -3049,16 +3049,16 @@ setup_xfer: if (error != 0) { switch (error) { - case EFBIG: + case __EFBIG: ecb->ccb->ccb_h.status |= CAM_REQ_TOO_BIG; break; - case EINPROGRESS: + case __EINPROGRESS: panic("%s: cannot deal with deferred DMA", __func__); - case EINVAL: + case __EINVAL: ecb->ccb->ccb_h.status |= CAM_REQ_INVALID; break; - case ENOMEM: + case __ENOMEM: ecb->ccb->ccb_h.status |= CAM_REQUEUE_REQ; break; default: Index: sys/dev/an/if_an.c =================================================================== --- sys/dev/an/if_an.c (revision 242394) +++ sys/dev/an/if_an.c (working copy) @@ -2592,7 +2592,7 @@ an_init_tx_ring(struct an_softc *sc) { int i; - int id; + int id = 0; if (sc->an_gone) return (0); Index: sys/dev/ichsmb/ichsmb.c =================================================================== --- sys/dev/ichsmb/ichsmb.c (revision 242394) +++ sys/dev/ichsmb/ichsmb.c (working copy) @@ -643,7 +643,7 @@ case 0: smb_error = sc->smb_error; break; - case EWOULDBLOCK: + case __EWOULDBLOCK: device_printf(dev, "device timeout, status=0x%02x\n", bus_read_1(sc->io_res, ICH_HST_STA)); sc->ich_cmd = -1; Index: sys/dev/syscons/syscons.c =================================================================== --- sys/dev/syscons/syscons.c (revision 242394) +++ sys/dev/syscons/syscons.c (working copy) @@ -2088,7 +2088,7 @@ switch (splash(sc->adp, TRUE)) { case 0: /* succeeded */ break; - case EAGAIN: /* try later */ + case __EAGAIN: /* try later */ restore_scrn_saver_mode(scp, FALSE); sc_touch_scrn_saver(); /* XXX */ break; Index: sys/dev/acpica/acpi_perf.c =================================================================== --- sys/dev/acpica/acpi_perf.c (revision 242394) +++ sys/dev/acpica/acpi_perf.c (working copy) @@ -199,7 +199,7 @@ bus_delete_resource(dev, type, rid); device_set_desc(dev, "ACPI CPU Frequency Control"); break; - case EOPNOTSUPP: + case __EOPNOTSUPP: device_quiet(dev); error = 0; break; Index: sys/dev/tws/tws_services.c =================================================================== --- sys/dev/tws/tws_services.c (revision 242394) +++ sys/dev/tws/tws_services.c (working copy) @@ -66,19 +66,19 @@ "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, { "Couldn't intialize CAM", 0x2007, ERROR, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, - { "Couldn't create SIM device queue", 0x2100, ENOMEM, + { "Couldn't create SIM device queue", 0x2100, __ENOMEM, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, - { "Unable to create SIM entry", 0x2101, ENOMEM, + { "Unable to create SIM entry", 0x2101, __ENOMEM, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, - { "Unable to register the bus", 0x2102, ENXIO, + { "Unable to register the bus", 0x2102, __ENXIO, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, - { "Unable to create the path", 0x2103, ENXIO, + { "Unable to create the path", 0x2103, __ENXIO, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, - { "Bus scan request to CAM failed", 0x2104, ENXIO, + { "Bus scan request to CAM failed", 0x2104, __ENXIO, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, - { "Unable to intialize the driver", 0x2008, ENXIO, + { "Unable to intialize the driver", 0x2008, __ENXIO, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, - { "Unable to intialize the controller", 0x2009, ENXIO, + { "Unable to intialize the controller", 0x2009, __ENXIO, "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" }, }; Index: sys/dev/ppbus/ppi.c =================================================================== --- sys/dev/ppbus/ppi.c (revision 242394) +++ sys/dev/ppbus/ppi.c (working copy) @@ -511,7 +511,7 @@ /* negotiate peripheral side with BYTE mode */ ppb_peripheral_negociate(ppbus, PPB_BYTE, 0); break; - case EWOULDBLOCK: + case __EWOULDBLOCK: break; default: goto error; Index: sys/dev/ppbus/lpt.c =================================================================== --- sys/dev/ppbus/lpt.c (revision 242394) +++ sys/dev/ppbus/lpt.c (working copy) @@ -807,11 +807,11 @@ * on polling for the last bytes */ sc->sc_xfercnt = 0; break; - case EINTR: + case __EINTR: sc->sc_state |= INTERRUPTED; ppb_unlock(ppbus); return (err); - case EINVAL: + case __EINVAL: /* advanced mode not avail */ log(LOG_NOTICE, "%s: advanced mode not avail, polling\n", Index: sys/dev/pci/pci.c =================================================================== --- sys/dev/pci/pci.c (revision 242394) +++ sys/dev/pci/pci.c (working copy) @@ -829,7 +829,7 @@ static int vpd_nextbyte(struct vpd_readstate *vrs, uint8_t *data) { - uint32_t reg; + uint32_t reg = 0; uint8_t byte; if (vrs->bytesinval == 0) { Index: sys/dev/mii/tlphy.c =================================================================== --- sys/dev/mii/tlphy.c (revision 242394) +++ sys/dev/mii/tlphy.c (working copy) @@ -341,7 +341,7 @@ int error; switch ((error = mii_phy_auto(&sc->sc_mii))) { - case EIO: + case __EIO: /* * Just assume we're not in full-duplex mode. * XXX Check link and try AUI/BNC? Index: sys/dev/virtio/scsi/virtio_scsi.c =================================================================== --- sys/dev/virtio/scsi/virtio_scsi.c (revision 242394) +++ sys/dev/virtio/scsi/virtio_scsi.c (working copy) @@ -1056,7 +1056,7 @@ struct ccb_hdr *ccbh; struct virtio_scsi_cmd_req *cmd_req; struct virtio_scsi_cmd_resp *cmd_resp; - int readable, writable, error; + int readable = 0, writable = 0, error; sg = sc->vtscsi_sglist; vq = sc->vtscsi_request_vq; Index: sys/dev/snc/if_snc_cbus.c =================================================================== --- sys/dev/snc/if_snc_cbus.c (revision 242394) +++ sys/dev/snc/if_snc_cbus.c (working copy) @@ -133,7 +133,7 @@ type = SNEC_TYPE_PNP; break; - case ENOENT: /* Legacy ISA */ + case __ENOENT: /* Legacy ISA */ type = SNEC_TYPE_LEGACY; break; Index: sys/dev/xen/netback/netback.c =================================================================== --- sys/dev/xen/netback/netback.c (revision 242394) +++ sys/dev/xen/netback/netback.c (working copy) @@ -2328,7 +2328,7 @@ error = xnb_send(rxb, xnb->otherend_id, mbufc, xnb->rx_gnttab); switch (error) { - case EAGAIN: + case __EAGAIN: /* * Insufficient space in the ring. * Requeue pkt and send when space is @@ -2343,7 +2343,7 @@ out_of_space = 1; break; - case EINVAL: + case __EINVAL: /* OS gave a corrupt packet. Drop it.*/ ifp->if_oerrors++; /* FALLTHROUGH */ Index: sys/dev/isp/isp_target.c =================================================================== --- sys/dev/isp/isp_target.c (revision 242394) +++ sys/dev/isp/isp_target.c (working copy) @@ -1223,7 +1223,7 @@ } else { ISP_MEMZERO(&rsp->abts_rsp_payload.ba_rjt, sizeof (rsp->abts_rsp_payload.ba_acc)); switch (errno) { - case ENOMEM: + case __ENOMEM: rsp->abts_rsp_payload.ba_rjt.reason = 5; /* Logical Unit Busy */ break; default: Index: sys/compat/linux/linux_ioctl.c =================================================================== --- sys/compat/linux/linux_ioctl.c (revision 242394) +++ sys/compat/linux/linux_ioctl.c (working copy) @@ -1612,7 +1612,7 @@ case LINUX_DVD_AUTH: { l_dvd_authinfo lda; struct dvd_authinfo bda; - int bcode; + int bcode = 0; error = copyin((void *)args->arg, &lda, sizeof(lda)); if (error) Index: sys/x86/acpica/madt.c =================================================================== --- sys/x86/acpica/madt.c (revision 242394) +++ sys/x86/acpica/madt.c (working copy) @@ -506,7 +506,7 @@ static void madt_parse_local_nmi(ACPI_MADT_LOCAL_APIC_NMI *nmi) { - u_int apic_id, pin; + u_int apic_id = 0, pin; if (nmi->ProcessorId == 0xff) apic_id = APIC_ID_ALL; Index: sys/net/if.c =================================================================== --- sys/net/if.c (revision 242394) +++ sys/net/if.c (working copy) @@ -428,7 +428,7 @@ if_alloc(u_char type) { struct ifnet *ifp; - u_short idx; + u_short idx = 0; ifp = malloc(sizeof(struct ifnet), M_IFNET, M_WAITOK|M_ZERO); IFNET_WLOCK(); Index: sys/geom/geom_ctl.c =================================================================== --- sys/geom/geom_ctl.c (revision 242394) +++ sys/geom/geom_ctl.c (working copy) @@ -298,13 +298,13 @@ { switch (gctl_set_param(req, param, ptr, len)) { - case EPERM: + case __EPERM: gctl_error(req, "No write access %s argument", param); break; - case ENOSPC: + case __ENOSPC: gctl_error(req, "Wrong length %s argument", param); break; - case EINVAL: + case __EINVAL: gctl_error(req, "Missing %s argument", param); break; }