Changeset 6c69d19 in mainline for uspace/lib/posix/unistd.c


Ignore:
Timestamp:
2011-07-25T20:34:17Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
00c2de63, c936c7f
Parents:
5889fc74 (diff), d542aad (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libposix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/unistd.c

    r5889fc74 r6c69d19  
    3131 * @{
    3232 */
    33 /** @file
     33/** @file Miscellaneous standard definitions.
    3434 */
    3535
     
    9090        /* Always returns false, because there is no easy way to find
    9191         * out under HelenOS. */
    92         return false;
     92        return 0;
    9393}
    9494
     
    207207                /* Check file existence by attempt to open it. */
    208208                int fd = open(path, O_RDONLY);
    209                 if (fd < 0) {
    210                         /* FIXME: open() returns error code as negative retval. */
    211                         errno = -fd;
    212                         fd = -1;
    213                 } else {
     209                if (fd != -1) {
    214210                        close(fd);
    215211                }
     
    239235                clk_tck = ((long) cpu_stats[0].frequency_mhz) * 1000000L;
    240236        }
    241         free(cpu_stats);
    242         cpu_stats = 0;
     237        if (cpu_stats) {
     238                free(cpu_stats);
     239                cpu_stats = 0;
     240        }
    243241
    244242        long phys_pages = 0;
     
    248246                phys_pages = (long) (mem_stats->total / getpagesize());
    249247                avphys_pages = (long) (mem_stats->free / getpagesize());
    250         }
    251         free(mem_stats);
    252         mem_stats = 0;
     248                free(mem_stats);
     249                mem_stats = 0;
     250        }
    253251
    254252        switch (name) {
Note: See TracChangeset for help on using the changeset viewer.