libc_fs: don't throw exception in 'open()'

Fixes #729.
This commit is contained in:
Christian Prochaska 2013-04-15 15:27:42 +02:00 committed by Norman Feske
parent 339a0354ce
commit e879cb1c32
1 changed files with 4 additions and 2 deletions

View File

@ -511,8 +511,10 @@ class Plugin : public Libc::Plugin
handle = file_system()->file(dir_handle, basename.base() + 1, mode, create);
opened = true;
} catch (File_system::Node_already_exists) {
if (flags & O_EXCL)
throw File_system::Node_already_exists();
if (flags & O_EXCL) {
errno = EEXIST;
return 0;
}
/* try to open the existing file */
try {
handle = file_system()->file(dir_handle, basename.base() + 1, mode, false);