Changeset 8565a42 in mainline for uspace/lib/posix/src/stdlib.c


Ignore:
Timestamp:
2018-03-02T20:34:50Z (7 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (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.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

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

    r3061bc1 r8565a42  
    165165                }
    166166        }
    167        
     167
    168168        return NULL;
    169169}
     
    225225                assert(resolved == NULL);
    226226        #endif
    227        
     227
    228228        if (name == NULL) {
    229229                errno = EINVAL;
    230230                return NULL;
    231231        }
    232        
     232
    233233        // TODO: symlink resolution
    234        
     234
    235235        /* Function absolutize is implemented in libc and declared in vfs.h.
    236236         * No more processing is required as HelenOS doesn't have symlinks
     
    239239         */
    240240        char* absolute = vfs_absolutize(name, NULL);
    241        
     241
    242242        if (absolute == NULL) {
    243243                /* POSIX requires some specific errnos to be set
     
    248248                return NULL;
    249249        }
    250        
     250
    251251        if (resolved == NULL) {
    252252                return absolute;
     
    309309{
    310310        int fd = -1;
    311        
     311
    312312        char *tptr = tmpl + strlen(tmpl) - 6;
    313        
     313
    314314        while (fd < 0) {
    315315                if (*mktemp(tmpl) == '\0') {
     
    317317                        return -1;
    318318                }
    319                
     319
    320320                fd = open(tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
    321                
     321
    322322                if (fd == -1) {
    323323                        /* Restore template to it's original state. */
     
    325325                }
    326326        }
    327        
     327
    328328        return fd;
    329329}
     
    345345                return tmpl;
    346346        }
    347        
     347
    348348        char *tptr = tmpl + tmpl_len - 6;
    349349        if (strcmp(tptr, "XXXXXX") != 0) {
     
    352352                return tmpl;
    353353        }
    354        
     354
    355355        static int seq = 0;
    356        
     356
    357357        for (; seq < 1000000; ++seq) {
    358358                snprintf(tptr, 7, "%06d", seq);
    359                
     359
    360360                int orig_errno = errno;
    361361                errno = 0;
     
    372372                }
    373373        }
    374        
     374
    375375        if (seq == 10000000) {
    376376                errno = EEXIST;
     
    378378                return tmpl;
    379379        }
    380        
     380
    381381        return tmpl;
    382382}
     
    392392{
    393393        assert(nelem > 0);
    394        
     394
    395395        size_t count;
    396396        load_t *loads = stats_get_load(&count);
    397        
     397
    398398        if (loads == NULL) {
    399399                return -1;
    400400        }
    401        
     401
    402402        if (((size_t) nelem) < count) {
    403403                count = nelem;
    404404        }
    405        
     405
    406406        for (size_t i = 0; i < count; ++i) {
    407407                loadavg[i] = (double) loads[i];
    408408        }
    409        
     409
    410410        free(loads);
    411411        return count;
Note: See TracChangeset for help on using the changeset viewer.