Subversion Repositories Kolibri OS

Rev

Rev 6725 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6725 Rev 6727
Line 114... Line 114...
114
    di.start = lastread_block;
114
    di.start = lastread_block;
115
    di.size = 1;
115
    di.size = 1;
Line 116... Line 116...
116
 
116
 
117
    int rc = sf_file(1, &di);  // read dir
117
    int rc = sf_file(1, &di);  // read dir
118
    if(rc) {
118
    if(rc) {
119
        fprintf(stderr, "Error %d reading dir item %s", rc, dirp->entry.d_name);
119
        fprintf(stderr, "Error %d reading dir item %s\n", rc, dirp->entry.d_name);
120
        errno = rc;
120
        errno = rc;
121
        return NULL;
121
        return NULL;
Line 122... Line 122...
122
    }
122
    }
Line 142... Line 142...
142
}
142
}
Line 143... Line 143...
143
 
143
 
144
 
144
 
145
int	mkdir(const char *_path, mode_t m)
-
 
146
{
145
int	mkdir(const char *_path, mode_t m)
147
    struct fs_dirinfo di;
146
{
Line -... Line 147...
-
 
147
    char   namebuffer[1050]; // need for save data after di!!!
-
 
148
    struct fs_dirinfo *di = (struct fs_dirinfo *)namebuffer;
-
 
149
 
-
 
150
debug_board_printf("mkdir start (%s)\n", _path);
-
 
151
    memset(di, 0, sizeof(struct fs_dirinfo));
148
    memset(&di, 0, sizeof di);
152
    //di.ppath = (char*)_path;  // dont work with 70.9
149
    di.ppath = (char*)_path;
153
    strcpy(di->path, _path);
150
 
154
 
151
    int rc = sf_file(9, &di);  // creat dir
155
    int rc = sf_file(9, di);  // creat dir
152
    if(rc) {
156
    if(rc) {
153
        fprintf(stderr, "Error %d creating dir item %s", rc, _path);
157
        fprintf(stderr, "Error %d creating dir item %s\n", rc, _path);
Line -... Line 158...
-
 
158
        errno = rc;
154
        errno = rc;
159
        return -1;
155
        return -1;
160
    }
Line -... Line 161...
-
 
161
 
-
 
162
debug_board_printf("mkdir end (%s)\n", _path);
-
 
163
    return 0;
-
 
164
}
-
 
165
 
-
 
166
////////////////////////////////////////////////////////////////////////////////////////
-
 
167
void __attribute__ ((noinline)) debug_board_write_str(const char* str){
-
 
168
  while(*str)
-
 
169
    debug_board_write_byte(*str++);
-
 
170
}
-
 
171
 
-
 
172
void __attribute__ ((noinline)) debug_board_printf(const char *format,...)
-
 
173
{
-
 
174
        va_list ap;
-
 
175
        char log_board[300];
-
 
176
 
-
 
177
        va_start (ap, format);
-
 
178
        vsnprintf(log_board, sizeof log_board, format, ap);
-
 
179
        va_end(ap);
-
 
180
        debug_board_write_str(log_board);
-
 
181
}
-
 
182
 
-
 
183
__attribute__ ((noinline)) void trap(int n)
-
 
184
{
-
 
185
    // nothing todo, just see n in debugger. use "bp trap" command
-
 
186
    __asm__ __volatile__(
-
 
187
    "nop"
Line 156... Line 188...
156
    }
188
    :
157
 
189
    :"a"(n));
158
    return 0;
190
}
159
}
191