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

@ -115,8 +115,8 @@ namespace Noux {
/* copy interpreter name into argument buffer */
unsigned int args_buf_cursor = 0;
Genode::strncpy(&_args[args_buf_cursor],
&binary_addr[interpreter_name_start],
interpreter_name_len + 1);
&binary_addr[interpreter_name_start],
interpreter_name_len + 1);
_binary_name = &_args[args_buf_cursor];
args_buf_cursor += interpreter_name_len + 1;
@ -130,8 +130,8 @@ namespace Noux {
size_t interpreter_args_len = eol - interpreter_line_cursor;
if (interpreter_args_len > 0) {
Genode::strncpy(&_args[args_buf_cursor],
&binary_addr[interpreter_line_cursor],
interpreter_args_len + 1);
&binary_addr[interpreter_line_cursor],
interpreter_args_len + 1);
args_buf_cursor += interpreter_args_len + 1;
}
@ -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

@ -39,7 +39,7 @@ namespace Noux {
virtual bool unlink(Sysio *sysio, char const *path) = 0;
virtual bool readlink(Sysio *sysio, char const *path) = 0;
virtual bool rename(Sysio *sysio, char const *from_path,
char const *to_path) = 0;
char const *to_path) = 0;
virtual bool mkdir(Sysio *sysio, char const *path) = 0;
virtual bool symlink(Sysio *sysio, char const *path) = 0;

View File

@ -310,11 +310,17 @@ 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;
case Directory_entry::TYPE_SYMLINK: type = Sysio::DIRENT_TYPE_SYMLINK; 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_SYMLINK: type = Sysio::DIRENT_TYPE_SYMLINK; break;
}
sysio->dirent_out.entry.type = type;

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

@ -61,7 +61,7 @@ namespace Noux {
Region *curr = _regions.first();
for (; curr; curr = curr->next()) {
if (curr->contains(local_addr))
return curr;
return curr;
}
return 0;
}

View File

@ -46,7 +46,7 @@ namespace Noux {
bool _is_terminal_file(const char *path)
{
return (strlen(path) == (strlen(_filename) + 1)) &&
(strcmp(&path[1], _filename) == 0);
(strcmp(&path[1], _filename) == 0);
}
public:

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];

View File

@ -39,7 +39,7 @@ namespace Noux {
bool _is_device_zero_file(const char *path)
{
return (strlen(path) == (strlen(_filename()) + 1)) &&
(strcmp(&path[1], _filename()) == 0);
(strcmp(&path[1], _filename()) == 0);
}
public: