summaryrefslogtreecommitdiff
path: root/src/journal/catalog.c
AgeCommit message (Collapse)Author
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-04-12journal: properly detect language specified in lineZbigniew Jędrzejewski-Szmek
... it turns out that the duplicates in our own catalog were not real duplicates, but translations.
2014-04-12journal: cleanup up error handling in update_catalog()Zbigniew Jędrzejewski-Szmek
- Negative/positive errno mixup caused duplicates not to be detected properly. Now we get a warning about some duplicate entries in our own catalogs... - Errors in update_catalog would be ignored, but they should not be.
2014-03-18util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering
safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
2013-12-22shared: switch our hash table implementation over to SipHashLennart Poettering
SipHash appears to be the new gold standard for hashing smaller strings for hashtables these days, so let's make use of it.
2013-12-15catalog: fix language detectionZbigniew Jędrzejewski-Szmek
Detection would fail if language was not specified in the filename but a dot appeared somewhere higher in the path.
2013-12-02catalog: determine language from the filenameZbigniew Jędrzejewski-Szmek
2013-10-13Never call qsort on potentially NULL arraysZbigniew Jędrzejewski-Szmek
This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero.
2013-04-18move _cleanup_ attribute in front of the typeHarald Hoyer
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-13fileio: in envfiles, do not skip lines following empty linesZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=63477
2013-03-28catalog: open up catalog internalsZbigniew Jędrzejewski-Szmek
In order to write tests for the catalog functions, they are made non-static and start taking a 'database' parameter, which is the name of a file with the preprocessed catalog entries. This makes it possible to make test-catalog part of the normal test suite, since it now only operates on files in /tmp. Some more tests are added.
2013-03-28catalog: make sure strings are terminatedZbigniew Jędrzejewski-Szmek
Coverity complains: systemd-199/src/journal/catalog.c:126: buffer_size_warning: Calling strncpy with a maximum size argument of 32 bytes on destination array "i->language" of size 32 bytes might leave the destination string unterminated. ...and unfortunately it was right. The string was defined as a fixed-size string in some parts of the code, and used a null-terminated string in others (e.g. in log statements). There's no point in conserving one byte, so just define the max language tag length to 31 bytes, and use null terminated strings everywhere. Also, wrap some lines, zero-fill less bytes, use '\0' instead of just 0 to be more explicit that this is one byte.
2013-03-27catalog: fix error codes handling in catalog_list_itemsLukas Nykryn
Previously r was set to zero and so if(r<0) was never true.
2013-03-27log: fix error codes handling in catalog_list_itemsLukas Nykryn
It does not make sense to print error code from previous loop.
2013-03-19journalct: beef up entry listingZbigniew Jędrzejewski-Szmek
The ability to dump catalog entries in full and by id is added.
2013-02-08shared: conf-files - add root parameterKay Sievers
2012-11-16journal: use $(localstatedir)/lib/systemd/catalog for the catalogZbigniew Jędrzejewski-Szmek
The path doesn't change in the standard configuration. Also, give full path to the journalctl binary in the hook, since it might be installed outside of $PATH. Also, add uninstall hook to remove the binary catalog.
2012-11-16journal, shared: fix warnings during compilation on 32 bitsZbigniew Jędrzejewski-Szmek
Some filesystem magics are too big to fit in 31 bits, and are wrapped to negative. f_type is an int on 32 bits, so it is signed, and we get a warning on comparison.
2012-11-16journal: catalog - silent output, it's usually only called by package managementKay Sievers
2012-11-16journalctl: better error messages for --update-catalogZbigniew Jędrzejewski-Szmek
Also add informational message about catalog size.
2012-11-16journal: extend catalog header to 64bit for all fields, just to be safe and ↵Lennart Poettering
follow the rest of the file formats
2012-11-15journal: implement message catalogLennart Poettering
The message catalog can be used to attach short help texts to log lines, keyed by their MESSAGE_ID= fields. This is useful to help the administrator understand the context and cause of a message, find possible solutions and find further related documentation. Since this is keyed off MESSAGE_ID= this will only work for native journal messages. The message catalog supports i18n, and is useful to augment english language system messages with explanations in the local language. This commit only includes short explanatory messages for a few example message IDs, we'll add more complete documentation for the relevant systemd messages later on.