| 347 | } |
| 348 | |
| 349 | static struct proc_dentry *proc_create_reg(const char *name, mode_t mode, struct proc_dentry **parent) |
| 350 | { |
| 351 | struct proc_dentry *dentry = RT_NULL; |
| 352 | |
| 353 | if ((mode & S_IFMT) == 0) |
| 354 | mode |= S_IFREG; |
| 355 | if ((mode & (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)) == 0) |
| 356 | mode |= S_IRUSR | S_IRGRP | S_IROTH; |
| 357 | |
| 358 | if (!S_ISREG(mode)) |
| 359 | { |
| 360 | *parent = RT_NULL; |
| 361 | return dentry; |
| 362 | } |
| 363 | |
| 364 | return proc_create(parent, name, mode); |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * @brief Make a file |
no test coverage detected