Changeset 243
- Timestamp:
- Aug 19, 2009, 9:11:53 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/slib.h
r214 r243 118 118 119 119 #define SL_EISDIR -1055 /* Is a directory */ 120 121 #define SL_EINTERNAL01 -1061 /* Internal error. */ 122 #define SL_EINTERNAL02 -1062 /* Internal error. */ 123 #define SL_EINTERNAL03 -1063 /* Internal error. */ 124 #define SL_EINTERNAL04 -1064 /* Internal error. */ 125 #define SL_EINTERNAL05 -1065 /* Internal error. */ 126 #define SL_EINTERNAL06 -1066 /* Internal error. */ 127 #define SL_EINTERNAL07 -1067 /* Internal error. */ 128 #define SL_EINTERNAL08 -1068 /* Internal error. */ 129 #define SL_EINTERNAL09 -1069 /* Internal error. */ 130 #define SL_EINTERNAL10 -1070 /* Internal error. */ 131 #define SL_EINTERNAL11 -1071 /* Internal error. */ 132 #define SL_EINTERNAL12 -1072 /* Internal error. */ 133 120 134 /* 121 135 * All int functions return SL_NONE on success. -
trunk/src/slib.c
r237 r243 1580 1580 1581 1581 if (myindex >= MAXFD) 1582 goto out_ticket; 1582 { 1583 retval = SL_EINTERNAL01; 1584 goto out_ticket; 1585 } 1583 1586 1584 1587 /* mask out the high bit and check that it is not used … … 1587 1590 high = (myindex + TOFFSET) & 0x7fff; 1588 1591 1589 if (high != myindex + TOFFSET) 1590 goto out_ticket; 1592 if (high != myindex + TOFFSET) 1593 { 1594 retval = SL_EINTERNAL02; 1595 goto out_ticket; 1596 } 1591 1597 1592 1598 SH_MUTEX_LOCK_UNSAFE(mutex_ticket); … … 1597 1603 */ 1598 1604 if ((low != nonce_counter++) || low == 0) 1599 goto out_ticket; 1605 { 1606 retval = SL_EINTERNAL03; 1607 goto out_ticket; 1608 } 1600 1609 1601 1610 /* Wrap around the nonce counter. … … 1631 1640 1632 1641 if ((of = ofiles[myindex])->fd < 0 || of->fd >= MAXFD ) 1633 return (SL_EINTERNAL );1642 return (SL_EINTERNAL04); 1634 1643 1635 1644 if (((of->ticket) & 0xffff) == 0) 1636 return (SL_EINTERNAL );1645 return (SL_EINTERNAL05); 1637 1646 1638 1647 return (myindex); … … 1653 1662 if (ofiles[fd] != NULL) 1654 1663 { 1655 SL_IRETURN(SL_EINTERNAL , _("sl_make_ticket"));1664 SL_IRETURN(SL_EINTERNAL06, _("sl_make_ticket")); 1656 1665 } 1657 1666 … … 1741 1750 SL_IRETURN(SL_ENULL, _("sl_open_file")); 1742 1751 if (mode < SL_OPEN_MIN || mode > SL_OPEN_MAX) 1743 SL_IRETURN(SL_EINTERNAL , _("sl_open_file"));1752 SL_IRETURN(SL_EINTERNAL07, _("sl_open_file")); 1744 1753 1745 1754 /* "This system call always succeeds and the previous value of … … 1863 1872 default: 1864 1873 errno = 0; 1865 SL_IRETURN(SL_EINTERNAL , _("sl_open_file"));1874 SL_IRETURN(SL_EINTERNAL08, _("sl_open_file")); 1866 1875 } 1867 1876 … … 1913 1922 { 1914 1923 close(fd); 1915 SL_IRETURN(SL_EINTERNAL , _("sl_open_file"));1924 SL_IRETURN(SL_EINTERNAL09, _("sl_open_file")); 1916 1925 } 1917 1926 … … 1961 1970 1962 1971 if (ofiles[fd] == NULL || fd != ofiles[fd]->fd || fd < 0) 1963 return (SL_EINTERNAL );1972 return (SL_EINTERNAL10); 1964 1973 return (fd); 1965 1974 } … … 1972 1981 SL_IRETURN(SL_ENULL, _("check_fname_priv")); 1973 1982 if (priv != SL_YESPRIV && priv != SL_NOPRIV) 1974 SL_IRETURN(SL_EINTERNAL , _("check_fname_priv"));1983 SL_IRETURN(SL_EINTERNAL11, _("check_fname_priv")); 1975 1984 SL_IRETURN(SL_ENONE, _("check_fname_priv")); 1976 1985 } … … 2140 2149 2141 2150 if (ofiles[fd] == NULL || fd != ofiles[fd]->fd || fd < 0) 2142 return (SL_EINTERNAL );2151 return (SL_EINTERNAL12); 2143 2152 2144 2153 if (ofiles[fd]->content) … … 2721 2730 case SL_EINTERNAL: 2722 2731 return _("Internal error"); 2732 case SL_EINTERNAL01: 2733 return _("Internal error 01"); 2734 case SL_EINTERNAL02: 2735 return _("Internal error 02"); 2736 case SL_EINTERNAL03: 2737 return _("Internal error 03"); 2738 case SL_EINTERNAL04: 2739 return _("Internal error 04"); 2740 case SL_EINTERNAL05: 2741 return _("Internal error 05"); 2742 case SL_EINTERNAL06: 2743 return _("Internal error 06"); 2744 case SL_EINTERNAL07: 2745 return _("Internal error 07"); 2746 case SL_EINTERNAL08: 2747 return _("Internal error 08"); 2748 case SL_EINTERNAL09: 2749 return _("Internal error 09"); 2750 case SL_EINTERNAL10: 2751 return _("Internal error 10"); 2752 case SL_EINTERNAL11: 2753 return _("Internal error 11"); 2754 case SL_EINTERNAL12: 2755 return _("Internal error 12"); 2723 2756 case SL_ETICKET: 2724 2757 return _("Bad ticket");
Note:
See TracChangeset
for help on using the changeset viewer.