Apply log levels to existing errors
This commit is contained in:
parent
a78ec21fea
commit
9665aa1df9
7 changed files with 19 additions and 14 deletions
|
|
@ -141,7 +141,7 @@ lumiera_filedescriptor_acquire (const char* name, int flags, LList filenode)
|
|||
INFO (filedescriptor, "try creating dir: %s", dir);
|
||||
if (mkdir (dir, 0777) == -1 && errno != EEXIST)
|
||||
{
|
||||
LUMIERA_ERROR_SET (filedescriptor, ERRNO, name);
|
||||
LUMIERA_ERROR_SET_CRITICAL (filedescriptor, ERRNO, name);
|
||||
goto error;
|
||||
}
|
||||
*slash = '/';
|
||||
|
|
@ -152,14 +152,14 @@ lumiera_filedescriptor_acquire (const char* name, int flags, LList filenode)
|
|||
fd = creat (name, 0666);
|
||||
if (fd == -1)
|
||||
{
|
||||
LUMIERA_ERROR_SET (filedescriptor, ERRNO, name);
|
||||
LUMIERA_ERROR_SET_CRITICAL (filedescriptor, ERRNO, name);
|
||||
goto error;
|
||||
}
|
||||
close (fd);
|
||||
if (stat (name, &fdesc.stat) != 0)
|
||||
{
|
||||
/* finally, no luck */
|
||||
LUMIERA_ERROR_SET (filedescriptor, ERRNO, name);
|
||||
LUMIERA_ERROR_SET_CRITICAL (filedescriptor, ERRNO, name);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ lumiera_filehandle_handle (LumieraFilehandle self)
|
|||
fd = open (lumiera_filedescriptor_name (self->descriptor), lumiera_filedescriptor_flags (self->descriptor) & LUMIERA_FILE_MASK);
|
||||
if (fd == -1)
|
||||
{
|
||||
LUMIERA_ERROR_SET (filehandle, ERRNO, lumiera_filedescriptor_name (self->descriptor));
|
||||
FIXME ("Handle EMFILE etc with the resourcecollector");
|
||||
LUMIERA_ERROR_SET_CRITICAL (filehandle, ERRNO, lumiera_filedescriptor_name (self->descriptor));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -92,13 +93,15 @@ lumiera_filehandle_handle (LumieraFilehandle self)
|
|||
if (fstat (fd, &st) == -1)
|
||||
{
|
||||
close (fd);
|
||||
LUMIERA_ERROR_SET (filehandle, ERRNO, lumiera_filedescriptor_name (self->descriptor));
|
||||
fd = -1;
|
||||
LUMIERA_ERROR_SET_CRITICAL (filehandle, ERRNO, lumiera_filedescriptor_name (self->descriptor));
|
||||
}
|
||||
else if (!lumiera_filedescriptor_samestat (self->descriptor, &st))
|
||||
{
|
||||
close (fd);
|
||||
fd = -1;
|
||||
/* Woops this is not the file we expected to use */
|
||||
LUMIERA_ERROR_SET (filehandle, FILE_CHANGED, lumiera_filedescriptor_name (self->descriptor));
|
||||
LUMIERA_ERROR_SET_CRITICAL (filehandle, FILE_CHANGED, lumiera_filedescriptor_name (self->descriptor));
|
||||
}
|
||||
}
|
||||
self->fd = fd;
|
||||
|
|
|
|||
|
|
@ -84,8 +84,9 @@ lumiera_filehandlecache_handle_acquire (LumieraFilehandlecache self, LumieraFile
|
|||
/* allocate new filehandle if we are below the limit or no cached handles are available (overallocating) */
|
||||
NOTICE (filehandlecache, "overallocating filehandle");
|
||||
ret = lumiera_filehandle_new (desc);
|
||||
TODO ("use resourcecollector here");
|
||||
if (!ret)
|
||||
LUMIERA_ERROR_SET (filehandlecache, FILEHANDLECACHE_NOHANDLE, lumiera_filedescriptor_name (desc));
|
||||
LUMIERA_ERROR_SET_ALERT (filehandlecache, FILEHANDLECACHE_NOHANDLE, lumiera_filedescriptor_name (desc));
|
||||
else
|
||||
--self->available;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ lumiera_mmap_init (LumieraMMap self, LumieraFile file, off_t start, size_t size)
|
|||
{
|
||||
TODO ("check if current mmapped size exceeds configured as_size (as_size be smaller than retrieved from getrlimit())");
|
||||
|
||||
TODO ("use resourcecllector here");
|
||||
switch (strategy++)
|
||||
{
|
||||
case FIRST_TRY:
|
||||
|
|
@ -173,7 +174,7 @@ lumiera_mmap_init (LumieraMMap self, LumieraFile file, off_t start, size_t size)
|
|||
break;
|
||||
|
||||
case GIVE_UP:
|
||||
LUMIERA_ERROR_SET (mmap, MMAP_SPACE, lumiera_filedescriptor_name (file->descriptor));
|
||||
LUMIERA_ERROR_SET_ALERT (mmap, MMAP_SPACE, lumiera_filedescriptor_name (file->descriptor));
|
||||
goto espace;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ lumiera_config_get (const char* key, const char** value)
|
|||
*value = item->delim+1;
|
||||
}
|
||||
else
|
||||
LUMIERA_ERROR_SET (configsys, CONFIG_NO_ENTRY, key);
|
||||
LUMIERA_ERROR_SET_WARNING (configsys, CONFIG_NO_ENTRY, key);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ lumiera_config_number_get (const char* key, long long* value)
|
|||
}
|
||||
}
|
||||
else
|
||||
LUMIERA_ERROR_SET (configsys, CONFIG_NO_ENTRY, key);
|
||||
LUMIERA_ERROR_SET_WARNING (configsys, CONFIG_NO_ENTRY, key);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ lumiera_config_string_get (const char* key, const char** value)
|
|||
*value = scan_string (raw_value);
|
||||
}
|
||||
else
|
||||
LUMIERA_ERROR_SET (configsys, CONFIG_NO_ENTRY, key);
|
||||
LUMIERA_ERROR_SET_WARNING (configsys, CONFIG_NO_ENTRY, key);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ lumiera_config_wordlist_get (const char* key, const char** value)
|
|||
*value = raw_value;
|
||||
}
|
||||
else
|
||||
LUMIERA_ERROR_SET (configsys, CONFIG_NO_ENTRY, key);
|
||||
LUMIERA_ERROR_SET_WARNING (configsys, CONFIG_NO_ENTRY, key);
|
||||
|
||||
TODO ("remove the ERROR_SET because config_get sets it already? also in all other getters in this file");
|
||||
}
|
||||
|
|
@ -322,7 +322,7 @@ lumiera_config_word_get (const char* key, const char** value)
|
|||
*value = scan_word (raw_value);
|
||||
}
|
||||
else
|
||||
LUMIERA_ERROR_SET (configsys, CONFIG_NO_ENTRY, key);
|
||||
LUMIERA_ERROR_SET_WARNING (configsys, CONFIG_NO_ENTRY, key);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ lumiera_plugin_register (LumieraPlugin plugin)
|
|||
}
|
||||
else
|
||||
{
|
||||
LUMIERA_ERROR_SET (plugin, PLUGIN_REGISTER, plugin->name);
|
||||
LUMIERA_ERROR_SET_CRITICAL (plugin, PLUGIN_REGISTER, plugin->name);
|
||||
}
|
||||
}
|
||||
return !!lumiera_error_peek();
|
||||
|
|
|
|||
Loading…
Reference in a new issue