Whitespace fixes in Noux

This commit is contained in:
Norman Feske 2012-10-05 15:41:35 +02:00
parent ec66788f11
commit f4bc08c16f
10 changed files with 34 additions and 34 deletions

View File

@ -157,7 +157,6 @@ namespace Noux {
Sysio::Env const &env() const { return _env; }
};
}
#endif /* _NOUX__CHILD_ENV_H_ */

View File

@ -190,9 +190,8 @@ namespace Noux {
sysio->error.stat = Sysio::STAT_ERR_NO_ENTRY;
/* path does not match directory name */
if (!path) {
if (!path)
return false;
}
/*
* If path equals directory name, return information about the
@ -274,6 +273,7 @@ namespace Noux {
sysio->dirent_out.entry.fileno = 1;
} else
sysio->dirent_out.entry.type = Sysio::DIRENT_TYPE_END;
return true;
}
@ -283,6 +283,7 @@ namespace Noux {
if (_is_root()) {
return _dirent_of_file_systems(sysio, path, index);
} else {
if (strcmp(path, "/") == 0)
@ -426,9 +427,8 @@ namespace Noux {
sysio->error.unlink = Sysio::UNLINK_ERR_NO_ENTRY;
/* path does not match directory name */
if (!path) {
if (!path)
return false;
}
/*
* Prevent unlinking if path equals directory name defined
@ -473,9 +473,8 @@ namespace Noux {
sysio->error.readlink = Sysio::READLINK_ERR_NO_ENTRY;
/* path does not match directory name */
if (!path) {
if (!path)
return false;
}
/* path refers to any of our sub file systems */
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;
/* path does not match directory name */
if (!from_path) {
if (!from_path)
return false;
}
/*
* 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) {
if (fs->rename(sysio, from_path, to_path)) {
return true;
} else {
/*
* Keep the most meaningful error code. When using
@ -558,9 +557,8 @@ namespace Noux {
sysio->error.symlink = Sysio::SYMLINK_ERR_NO_ENTRY;
/* path does not match directory name */
if (!path) {
if (!path)
return false;
}
/*
* 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) {
if (fs->symlink(sysio, path)) {
return true;
} else {
/*
* Keep the most meaningful error code. When using
@ -600,9 +599,8 @@ namespace Noux {
sysio->error.mkdir = Sysio::MKDIR_ERR_NO_ENTRY;
/* path does not match directory name */
if (!path) {
if (!path)
return false;
}
/*
* Prevent mkdir of path that equals directory name defined

View File

@ -310,7 +310,13 @@ namespace Noux {
Directory_entry const *entry =
(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) {
case Directory_entry::TYPE_DIRECTORY: type = Sysio::DIRENT_TYPE_DIRECTORY; break;
case Directory_entry::TYPE_FILE: type = Sysio::DIRENT_TYPE_FILE; break;

View File

@ -255,14 +255,15 @@ bool Noux::Child::syscall(Noux::Session::Syscall sc)
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())
throw Child::Binary_does_not_exist();
Child_env<sizeof(_sysio->execve_in.args)> child_env(
_sysio->execve_in.filename, binary_ds, _sysio->execve_in.args,
_sysio->execve_in.env);
Child_env<sizeof(_sysio->execve_in.args)>
child_env(_sysio->execve_in.filename, binary_ds,
_sysio->execve_in.args, _sysio->execve_in.env);
_root_dir->release(_sysio->execve_in.filename, binary_ds);

View File

@ -120,18 +120,13 @@ namespace Noux {
switch (sysio->fcntl_in.cmd) {
case Sysio::FCNTL_CMD_GET_FILE_STATUS_FLAGS:
{
sysio->fcntl_out.result = 0;
return true;
}
default:
{
return false;
}
}
return false;
}

View File

@ -24,6 +24,7 @@
namespace Noux {
struct User_info {
public:
char name[Sysio::MAX_USERNAME_LEN];