Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/time.c

    rb7fd2a0 r38d150e  
    585585        if (clock_conn == NULL) {
    586586                category_id_t cat_id;
    587                 errno_t rc = loc_category_get_id("clock", &cat_id, IPC_FLAG_BLOCKING);
     587                int rc = loc_category_get_id("clock", &cat_id, IPC_FLAG_BLOCKING);
    588588                if (rc != EOK)
    589589                        goto fallback;
     
    617617       
    618618        struct tm time;
    619         errno_t rc = clock_dev_time_get(clock_conn, &time);
     619        int rc = clock_dev_time_get(clock_conn, &time);
    620620        if (rc != EOK)
    621621                goto fallback;
     
    634634        if (ktime == NULL) {
    635635                uintptr_t faddr;
    636                 errno_t rc = sysinfo_get_value("clock.faddr", &faddr);
     636                int rc = sysinfo_get_value("clock.faddr", &faddr);
    637637                if (rc != EOK) {
    638638                        errno = rc;
     
    954954 * @param result Structure to store the result to
    955955 *
    956  * @return EOK or an error code
    957  *
    958  */
    959 errno_t time_utc2tm(const time_t time, struct tm *restrict result)
     956 * @return EOK or a negative error code
     957 *
     958 */
     959int time_utc2tm(const time_t time, struct tm *restrict result)
    960960{
    961961        assert(result != NULL);
     
    984984 *             ASCTIME_BUF_LEN bytes long.
    985985 *
    986  * @return EOK or an error code.
    987  *
    988  */
    989 errno_t time_utc2str(const time_t time, char *restrict buf)
     986 * @return EOK or a negative error code.
     987 *
     988 */
     989int time_utc2str(const time_t time, char *restrict buf)
    990990{
    991991        struct tm tm;
    992         errno_t ret = time_utc2tm(time, &tm);
     992        int ret = time_utc2tm(time, &tm);
    993993        if (ret != EOK)
    994994                return ret;
     
    10361036 * @param result Structure to store the result to.
    10371037 *
    1038  * @return EOK on success or an error code.
    1039  *
    1040  */
    1041 errno_t time_tv2tm(const struct timeval *tv, struct tm *restrict result)
     1038 * @return EOK on success or a negative error code.
     1039 *
     1040 */
     1041int time_tv2tm(const struct timeval *tv, struct tm *restrict result)
    10421042{
    10431043        // TODO: Deal with timezones.
     
    10661066 * @param result Structure to store the result to.
    10671067 *
    1068  * @return EOK on success or an error code.
    1069  *
    1070  */
    1071 errno_t time_local2tm(const time_t time, struct tm *restrict result)
     1068 * @return EOK on success or a negative error code.
     1069 *
     1070 */
     1071int time_local2tm(const time_t time, struct tm *restrict result)
    10721072{
    10731073        struct timeval tv = {
     
    10881088 *              ASCTIME_BUF_LEN bytes long.
    10891089 *
    1090  * @return EOK on success or an error code.
    1091  *
    1092  */
    1093 errno_t time_local2str(const time_t time, char *buf)
     1090 * @return EOK on success or a negative error code.
     1091 *
     1092 */
     1093int time_local2str(const time_t time, char *buf)
    10941094{
    10951095        struct tm loctime;
    1096         errno_t ret = time_local2tm(time, &loctime);
     1096        int ret = time_local2tm(time, &loctime);
    10971097        if (ret != EOK)
    10981098                return ret;
Note: See TracChangeset for help on using the changeset viewer.