Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset f215bb5 in mainline


Ignore:
Timestamp:
2011-07-27T21:24:32Z (10 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
fd4b636
Parents:
77c6698
Message:

Various little changes.

Location:
uspace/lib/posix
Files:
5 edited

Legend:

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

    r77c6698 rf215bb5  
    9494int posix_isprint(int c)
    9595{
    96         return posix_isacsii(c) && !posix_iscntrl(c);
     96        return posix_isascii(c) && !posix_iscntrl(c);
    9797}
    9898
  • uspace/lib/posix/fnmatch.c

    r77c6698 rf215bb5  
    525525static char *_casefold(const char *s)
    526526{
     527        assert(s != NULL);
    527528        char *result = strdup(s);
    528529        for (char *i = result; *i != '\0'; ++i) {
     
    542543int posix_fnmatch(const char *pattern, const char *string, int flags)
    543544{
     545        assert(pattern != NULL);
     546        assert(string != NULL);
     547
    544548        // TODO: don't fold everything in advance, but only when needed
    545549
  • uspace/lib/posix/pwd.c

    r77c6698 rf215bb5  
    3939#include "errno.h"
    4040
    41 // TODO: documentation
    42 
    4341static bool entry_read = false;
    4442
     
    4644static const struct posix_passwd dummy_pwd = {
    4745        .pw_name = (char *) "user",
    48         .pw_uid = 1,
    49         .pw_gid = 1,
     46        .pw_uid = 0,
     47        .pw_gid = 0,
    5048        .pw_dir = (char *) "/",
    5149        .pw_shell = (char *) "/app/bdsh"
     
    115113{
    116114        assert(name != NULL);
     115        assert(pwd != NULL);
     116        assert(buffer != NULL);
     117        assert(result != NULL);
    117118       
    118119        if (posix_strcmp(name, "user") != 0) {
     
    121122        }
    122123       
    123         return posix_getpwuid_r(1, pwd, buffer, bufsize, result);
     124        return posix_getpwuid_r(0, pwd, buffer, bufsize, result);
    124125}
    125126
     
    132133struct posix_passwd *posix_getpwuid(posix_uid_t uid)
    133134{
    134         if (uid != 1) {
     135        if (uid != 0) {
    135136                return NULL;
    136137        }
     
    159160            '/', '\0', 'b', 'd', 's', 'h', '\0' };
    160161       
    161         if (uid != 1) {
     162        if (uid != 0) {
    162163                *result = NULL;
    163164                return 0;
     
    171172
    172173        pwd->pw_name = (char *) bf;
    173         pwd->pw_uid = 1;
    174         pwd->pw_gid = 1;
     174        pwd->pw_uid = 0;
     175        pwd->pw_gid = 0;
    175176        pwd->pw_dir = (char *) bf + 5;
    176177        pwd->pw_shell = (char *) bf + 7;
  • uspace/lib/posix/pwd.h

    r77c6698 rf215bb5  
    3535#ifndef POSIX_PWD_H_
    3636#define POSIX_PWD_H_
    37 
    38 // TODO: documentation
    3937
    4038#include "sys/types.h"
  • uspace/lib/posix/signal.c

    r77c6698 rf215bb5  
    6666
    6767/**
    68  *
    69  * @param signo
     68 * Default signal handler. Executes the default action for each signal,
     69 * as reasonable within HelenOS.
     70 *
     71 * @param signo Signal number.
    7072 */
    7173void __posix_default_signal_handler(int signo)
     
    7577                abort();
    7678        case SIGQUIT:
    77                 fprintf(stderr, "Quit signal raised. Exiting.");
     79                fprintf(stderr, "Quit signal raised. Exiting.\n");
    7880                exit(EXIT_FAILURE);
    7981        case SIGINT:
    80                 fprintf(stderr, "Interrupt signal caught. Exiting.");
     82                fprintf(stderr, "Interrupt signal caught. Exiting.\n");
    8183                exit(EXIT_FAILURE);
    8284        case SIGTERM:
    83                 fprintf(stderr, "Termination signal caught. Exiting.");
     85                fprintf(stderr, "Termination signal caught. Exiting.\n");
    8486                exit(EXIT_FAILURE);
    8587        case SIGSTOP:
    86                 fprintf(stderr, "Stop signal caught, but unsupported. Ignoring.");
     88                fprintf(stderr, "Stop signal caught, but unsupported. Ignoring.\n");
    8789                break;
    8890        case SIGKILL:
Note: See TracChangeset for help on using the changeset viewer.