Merge branch 'master' of git.lfbs.rwth-aachen.de:metalsvm
This commit is contained in:
commit
f371f8e7b9
2 changed files with 13 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <metalsvm/errno.h>
|
||||
#include <metalsvm/spinlock.h>
|
||||
#include <metalsvm/time.h>
|
||||
#include <metalsvm/fs.h>
|
||||
#include <lwip/opt.h>
|
||||
|
||||
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||
|
@ -122,7 +123,16 @@ static int sys_stat(const char* name, struct stat* st)
|
|||
|
||||
st->st_dev = 0; /* ID of device containing file */
|
||||
st->st_ino = 0; /* inode number */
|
||||
st->st_mode = node->mask; /* protection */
|
||||
|
||||
/* convert FS_TYPES in newlib FS_TYPES */
|
||||
switch (node->type)
|
||||
{
|
||||
case FS_FILE: st->st_mode = 0060000; break;
|
||||
case FS_DIRECTORY: st->st_mode = 0040000; break;
|
||||
case FS_CHARDEVICE: st->st_mode = 0020000; break;
|
||||
default: st->st_mode = 0; break;
|
||||
}
|
||||
|
||||
st->st_nlink = 0; /* number of hard links */
|
||||
st->st_uid = node->uid; /* user ID of owner */
|
||||
st->st_gid = node->gid; /* group ID of owner */
|
||||
|
|
|
@ -53,7 +53,7 @@ void help() {
|
|||
#define ST_ARG 1
|
||||
#define ST_QUOTE 2
|
||||
|
||||
#define USE_STAT 0
|
||||
#define USE_STAT 1
|
||||
|
||||
char** splitargs(char* args) {
|
||||
static char* ret[MAXARGS+1];
|
||||
|
@ -117,7 +117,7 @@ void ms_setcwd(char* path) {
|
|||
|
||||
#if USE_STAT
|
||||
if (stat(newpath, &stats)) {
|
||||
printf("mshell: %s is not a valid path\n", newpath);
|
||||
printf("mshell: %s is not a valid path\n XY", newpath);
|
||||
return;
|
||||
}
|
||||
if (!S_ISDIR(stats.st_mode)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue