mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-03 01:02:56 +00:00
Whitespace fixes in Noux
This commit is contained in:
parent
ec66788f11
commit
f4bc08c16f
@ -157,7 +157,6 @@ namespace Noux {
|
|||||||
|
|
||||||
Sysio::Env const &env() const { return _env; }
|
Sysio::Env const &env() const { return _env; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _NOUX__CHILD_ENV_H_ */
|
#endif /* _NOUX__CHILD_ENV_H_ */
|
||||||
|
@ -190,9 +190,8 @@ namespace Noux {
|
|||||||
sysio->error.stat = Sysio::STAT_ERR_NO_ENTRY;
|
sysio->error.stat = Sysio::STAT_ERR_NO_ENTRY;
|
||||||
|
|
||||||
/* path does not match directory name */
|
/* path does not match directory name */
|
||||||
if (!path) {
|
if (!path)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If path equals directory name, return information about the
|
* If path equals directory name, return information about the
|
||||||
@ -274,6 +273,7 @@ namespace Noux {
|
|||||||
sysio->dirent_out.entry.fileno = 1;
|
sysio->dirent_out.entry.fileno = 1;
|
||||||
} else
|
} else
|
||||||
sysio->dirent_out.entry.type = Sysio::DIRENT_TYPE_END;
|
sysio->dirent_out.entry.type = Sysio::DIRENT_TYPE_END;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,6 +283,7 @@ namespace Noux {
|
|||||||
|
|
||||||
if (_is_root()) {
|
if (_is_root()) {
|
||||||
return _dirent_of_file_systems(sysio, path, index);
|
return _dirent_of_file_systems(sysio, path, index);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (strcmp(path, "/") == 0)
|
if (strcmp(path, "/") == 0)
|
||||||
@ -426,9 +427,8 @@ namespace Noux {
|
|||||||
sysio->error.unlink = Sysio::UNLINK_ERR_NO_ENTRY;
|
sysio->error.unlink = Sysio::UNLINK_ERR_NO_ENTRY;
|
||||||
|
|
||||||
/* path does not match directory name */
|
/* path does not match directory name */
|
||||||
if (!path) {
|
if (!path)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prevent unlinking if path equals directory name defined
|
* Prevent unlinking if path equals directory name defined
|
||||||
@ -473,9 +473,8 @@ namespace Noux {
|
|||||||
sysio->error.readlink = Sysio::READLINK_ERR_NO_ENTRY;
|
sysio->error.readlink = Sysio::READLINK_ERR_NO_ENTRY;
|
||||||
|
|
||||||
/* path does not match directory name */
|
/* path does not match directory name */
|
||||||
if (!path) {
|
if (!path)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
/* path refers to any of our sub file systems */
|
/* path refers to any of our sub file systems */
|
||||||
for (File_system *fs = _first_file_system; fs; fs = fs->next) {
|
for (File_system *fs = _first_file_system; fs; fs = fs->next) {
|
||||||
@ -506,9 +505,8 @@ namespace Noux {
|
|||||||
sysio->error.rename = Sysio::RENAME_ERR_NO_ENTRY;
|
sysio->error.rename = Sysio::RENAME_ERR_NO_ENTRY;
|
||||||
|
|
||||||
/* path does not match directory name */
|
/* path does not match directory name */
|
||||||
if (!from_path) {
|
if (!from_path)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prevent renaming if path equals directory name defined
|
* Prevent renaming if path equals directory name defined
|
||||||
@ -533,6 +531,7 @@ namespace Noux {
|
|||||||
for (File_system *fs = _first_file_system; fs; fs = fs->next) {
|
for (File_system *fs = _first_file_system; fs; fs = fs->next) {
|
||||||
if (fs->rename(sysio, from_path, to_path)) {
|
if (fs->rename(sysio, from_path, to_path)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Keep the most meaningful error code. When using
|
* Keep the most meaningful error code. When using
|
||||||
@ -558,9 +557,8 @@ namespace Noux {
|
|||||||
sysio->error.symlink = Sysio::SYMLINK_ERR_NO_ENTRY;
|
sysio->error.symlink = Sysio::SYMLINK_ERR_NO_ENTRY;
|
||||||
|
|
||||||
/* path does not match directory name */
|
/* path does not match directory name */
|
||||||
if (!path) {
|
if (!path)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prevent symlink of path that equals directory name defined
|
* Prevent symlink of path that equals directory name defined
|
||||||
@ -575,6 +573,7 @@ namespace Noux {
|
|||||||
for (File_system *fs = _first_file_system; fs; fs = fs->next) {
|
for (File_system *fs = _first_file_system; fs; fs = fs->next) {
|
||||||
if (fs->symlink(sysio, path)) {
|
if (fs->symlink(sysio, path)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Keep the most meaningful error code. When using
|
* Keep the most meaningful error code. When using
|
||||||
@ -600,9 +599,8 @@ namespace Noux {
|
|||||||
sysio->error.mkdir = Sysio::MKDIR_ERR_NO_ENTRY;
|
sysio->error.mkdir = Sysio::MKDIR_ERR_NO_ENTRY;
|
||||||
|
|
||||||
/* path does not match directory name */
|
/* path does not match directory name */
|
||||||
if (!path) {
|
if (!path)
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prevent mkdir of path that equals directory name defined
|
* Prevent mkdir of path that equals directory name defined
|
||||||
|
@ -310,7 +310,13 @@ namespace Noux {
|
|||||||
Directory_entry const *entry =
|
Directory_entry const *entry =
|
||||||
(Directory_entry *)source.packet_content(packet);
|
(Directory_entry *)source.packet_content(packet);
|
||||||
|
|
||||||
Sysio::Dirent_type type;
|
/*
|
||||||
|
* The default value has no meaning because the switch below
|
||||||
|
* assigns a value in each possible branch. But it is needed to
|
||||||
|
* keep the compiler happy.
|
||||||
|
*/
|
||||||
|
Sysio::Dirent_type type = Sysio::DIRENT_TYPE_END;
|
||||||
|
|
||||||
switch (entry->type) {
|
switch (entry->type) {
|
||||||
case Directory_entry::TYPE_DIRECTORY: type = Sysio::DIRENT_TYPE_DIRECTORY; break;
|
case Directory_entry::TYPE_DIRECTORY: type = Sysio::DIRENT_TYPE_DIRECTORY; break;
|
||||||
case Directory_entry::TYPE_FILE: type = Sysio::DIRENT_TYPE_FILE; break;
|
case Directory_entry::TYPE_FILE: type = Sysio::DIRENT_TYPE_FILE; break;
|
||||||
|
@ -255,14 +255,15 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc)
|
|||||||
|
|
||||||
case SYSCALL_EXECVE:
|
case SYSCALL_EXECVE:
|
||||||
{
|
{
|
||||||
Dataspace_capability binary_ds = _root_dir->dataspace(_sysio->execve_in.filename);
|
Dataspace_capability binary_ds =
|
||||||
|
_root_dir->dataspace(_sysio->execve_in.filename);
|
||||||
|
|
||||||
if (!binary_ds.valid())
|
if (!binary_ds.valid())
|
||||||
throw Child::Binary_does_not_exist();
|
throw Child::Binary_does_not_exist();
|
||||||
|
|
||||||
Child_env<sizeof(_sysio->execve_in.args)> child_env(
|
Child_env<sizeof(_sysio->execve_in.args)>
|
||||||
_sysio->execve_in.filename, binary_ds, _sysio->execve_in.args,
|
child_env(_sysio->execve_in.filename, binary_ds,
|
||||||
_sysio->execve_in.env);
|
_sysio->execve_in.args, _sysio->execve_in.env);
|
||||||
|
|
||||||
_root_dir->release(_sysio->execve_in.filename, binary_ds);
|
_root_dir->release(_sysio->execve_in.filename, binary_ds);
|
||||||
|
|
||||||
|
@ -120,18 +120,13 @@ namespace Noux {
|
|||||||
switch (sysio->fcntl_in.cmd) {
|
switch (sysio->fcntl_in.cmd) {
|
||||||
|
|
||||||
case Sysio::FCNTL_CMD_GET_FILE_STATUS_FLAGS:
|
case Sysio::FCNTL_CMD_GET_FILE_STATUS_FLAGS:
|
||||||
{
|
|
||||||
sysio->fcntl_out.result = 0;
|
sysio->fcntl_out.result = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
namespace Noux {
|
namespace Noux {
|
||||||
|
|
||||||
struct User_info {
|
struct User_info {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
char name[Sysio::MAX_USERNAME_LEN];
|
char name[Sysio::MAX_USERNAME_LEN];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user