Ignore:
Timestamp:
2008-06-04T19:17:36Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32443b0
Parents:
7ba289a
Message:

resurrect klog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/syscall/syscall.c

    r7ba289a r82b71ef1  
    6464        int rc;
    6565
    66         if (count == 0)
    67                 return 0;
    68 
    6966        if (count > PAGE_SIZE)
    7067                return ELIMIT;
    71 
    72         data = (char *) malloc(count, 0);
    73         if (!data)
    74                 return ENOMEM;
    7568       
    76         rc = copy_from_uspace(data, buf, count);
    77         if (rc) {
     69        if (count > 0) {
     70                data = (char *) malloc(count, 0);
     71                if (!data)
     72                        return ENOMEM;
     73               
     74                rc = copy_from_uspace(data, buf, count);
     75                if (rc) {
     76                        free(data);
     77                        return rc;
     78                }
     79       
     80                for (i = 0; i < count; i++)
     81                        putchar(data[i]);
    7882                free(data);
    79                 return rc;
    80         }
    81 
    82         for (i = 0; i < count; i++)
    83                 putchar(data[i]);
    84         free(data);
     83        } else
     84                klog_update();
    8585       
    8686        return count;
Note: See TracChangeset for help on using the changeset viewer.