Changeset 3fafe5e0 in mainline for uspace/lib/posix/src/time.c


Ignore:
Timestamp:
2018-04-27T14:15:03Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7148abf
Parents:
a2eb85d
git-author:
Jiri Svoboda <jiri@…> (2018-04-26 17:14:26)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-27 14:15:03)
Message:

Fix incorrectly indented double-slash comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/time.c

    ra2eb85d r3fafe5e0  
    216216
    217217        switch (clock_id) {
    218                 case CLOCK_REALTIME:
    219                         res->tv_sec = 0;
    220                         res->tv_nsec = 1000; /* Microsecond resolution. */
    221                         return 0;
    222                 default:
    223                         errno = EINVAL;
    224                         return -1;
     218        case CLOCK_REALTIME:
     219                res->tv_sec = 0;
     220                res->tv_nsec = 1000; /* Microsecond resolution. */
     221                return 0;
     222        default:
     223                errno = EINVAL;
     224                return -1;
    225225        }
    226226}
     
    240240
    241241        switch (clock_id) {
    242                 case CLOCK_REALTIME:
    243                         gettimeofday(&tv, NULL);
    244                         tp->tv_sec = tv.tv_sec;
    245                         tp->tv_nsec = tv.tv_usec * 1000;
    246                         return 0;
    247                 default:
    248                         errno = EINVAL;
    249                         return -1;
     242        case CLOCK_REALTIME:
     243                gettimeofday(&tv, NULL);
     244                tp->tv_sec = tv.tv_sec;
     245                tp->tv_nsec = tv.tv_usec * 1000;
     246                return 0;
     247        default:
     248                errno = EINVAL;
     249                return -1;
    250250        }
    251251}
     
    265265
    266266        switch (clock_id) {
    267                 case CLOCK_REALTIME:
    268                         // TODO: setting clock
    269                         // FIXME: HelenOS doesn't actually support hardware
    270                         //        clock yet
    271                         errno = EPERM;
    272                         return -1;
    273                 default:
    274                         errno = EINVAL;
    275                         return -1;
     267        case CLOCK_REALTIME:
     268                // TODO: setting clock
     269                // FIXME: HelenOS doesn't actually support hardware
     270                //        clock yet
     271                errno = EPERM;
     272                return -1;
     273        default:
     274                errno = EINVAL;
     275                return -1;
    276276        }
    277277}
     
    293293
    294294        switch (clock_id) {
    295                 case CLOCK_REALTIME:
    296                         // TODO: interruptible sleep
    297                         if (rqtp->tv_sec != 0) {
    298                                 async_sleep(rqtp->tv_sec);
    299                         }
    300                         if (rqtp->tv_nsec != 0) {
    301                                 async_usleep(rqtp->tv_nsec / 1000);
    302                         }
    303                         return 0;
    304                 default:
    305                         errno = EINVAL;
    306                         return -1;
     295        case CLOCK_REALTIME:
     296                // TODO: interruptible sleep
     297                if (rqtp->tv_sec != 0) {
     298                        async_sleep(rqtp->tv_sec);
     299                }
     300                if (rqtp->tv_nsec != 0) {
     301                        async_usleep(rqtp->tv_nsec / 1000);
     302                }
     303                return 0;
     304        default:
     305                errno = EINVAL;
     306                return -1;
    307307        }
    308308}
Note: See TracChangeset for help on using the changeset viewer.