summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* localalloc: Fix extra indirection on gs_strfrev implementationColin Walters2013-08-291-10/+10
| | | | | | This was tripping a compiler warning in NetworkManager; the right way to fix it is actually to be less magical in the macro and lose our synthesized *. Instead add it explicitly for each type.
* localalloc: Add gs_strfreevColin Walters2013-08-292-0/+14
| | | | NetworkManager uses strvs quite a lot.
* fileutil: Fix -Wshadow warning with "index"Colin Walters2013-08-261-4/+4
| | | | Reported-by: Pavel Šimerda <psimerda@redhat.com>
* gsystem-log: Correctly suppress systemd journal code locationColin Walters2013-08-201-2/+1
| | | | It's not useful since we're wrapping the API.
* gsystem-log: Fix double-logging on non-systemd systemsColin Walters2013-08-161-0/+2
| | | | I was getting duplicated output on RHEL6.
* fileutils: Add API to fstat() a streamColin Walters2013-08-142-0/+47
| | | | | | | | | Will be used by ostree. Since libgsystem will return raw GUnix{Input,Output}Stream, we need a way to fstat() them. Maybe we should also have an API to synthesize a #GFileInfo, but that's hard without duplicating all the complex stuff in GIO. https://bugzilla.gnome.org/show_bug.cgi?id=706031
* localalloc: Add gs_unref_bytes()Colin Walters2013-08-142-0/+16
| | | | Since I'm using these more now in ostree, and let's be comprehensive.
* localalloc: Fix variant builder unrefColin Walters2013-08-142-5/+5
| | | | | | I will test my code before pushing. I will test my code before pushing. I will test my code before pushing.
* local-alloc: Fix previous commitColin Walters2013-08-141-1/+1
|
* localalloc: Add cleanup functions for checksum and variant buildersColin Walters2013-08-142-0/+31
| | | | Used in ostree.
* fileutils: Fix fd leakColin Walters2013-08-071-2/+3
|
* fileutil: Add new API to open a temporary file in a particular directoryColin Walters2013-08-062-0/+77
| | | | This is useful for ostree to write to repo/tmp.
* localalloc: Add gs_unref_array()Colin Walters2013-08-022-0/+17
| | | | Requested by NetworkManager team.
* gsystem-log: Add public API to determine whether stdout is journalColin Walters2013-07-242-15/+29
| | | | | Will be used by gnome-desktop-testing to determine whether or not it should set up the journal for its children.
* fileutils: Add gs_file_create_with_uidgid()Colin Walters2013-07-182-0/+84
| | | | | | | | If the provided mode includes S_ISUID or S_ISGID, we will successfully invoke fchmod(), but then a subsequent chown() will undo any setuid bits, even if we're just calling chown for the already extant uid. This API can reliably create a file with the provided mode and owner.
* fileutils: Override umask for gs_file_create()Colin Walters2013-07-171-0/+6
| | | | | | | | | The entire point of this API is to atomically create a file with the given mode; we need to fchmod() in order to get exactly what is specified. This fixes gnome-ostree which uses ostree to check out trees; we were losing the g-w bit on checked out files.
* fileutils: Handles return value of realpath in case of errorsAlberto Ruiz2013-07-181-2/+8
| | | | Signed-off-by: Alberto Ruiz <aruiz@gnome.org>
* fileutil: Make API to generate temporary name publicColin Walters2013-07-162-4/+16
| | | | It's used by ostree core too.
* gs_file_create: New APIColin Walters2013-07-162-0/+45
| | | | | | | This allows ostree core to drop an invocation of chmod() after creating the file. See https://bugzilla.gnome.org/show_bug.cgi?id=699959
* Add gs_transfer_out_value() macroColin Walters2013-07-051-0/+8
| | | | A simple macro to help with out parameters.
* GSSubprocessContext: Avoid triggering -Wshadow for "environ"Colin Walters2013-06-211-2/+2
|
* fileutils: Add gs_file_realpath as wellJasper St. Pierre2013-06-192-0/+25
|
* fileutils: Add gs_system_get_relpathJasper St. Pierre2013-06-192-0/+77
| | | | This will properly emit "../../foo" now for files with different parents.
* fileutils: Add gs_file_enumerator_iterate()Colin Walters2013-06-142-0/+100
| | | | This is much more convenient to use correctly from C.
* Add glib-compat to Makefile to ensure it's distedColin Walters2013-05-281-0/+1
| | | | For people who still distcheck.
* Add missing #endifColin Walters2013-05-221-0/+1
|
* Add gsystem-glib-compat.h to support compilation with GLib 2.32Colin Walters2013-05-212-0/+54
| | | | For NetworkManager.
* gsystem-log: Add API to more conveniently print a message with just MESSAGE_IDColin Walters2013-05-202-0/+33
|
* Build with GLib 2.32 as wellColin Walters2013-05-178-0/+23
| | | | Needed by NetworkManager.
* GSSubprocess: Use #ifdef, not #if for GLIB_COMPILATIONColin Walters2013-05-161-1/+1
| | | | | It's not defined normally, and this triggers -Wundef which some projects make into an error.
* log: Squash warning when building without systemdColin Walters2013-05-091-0/+2
|
* gs_log_structured_print(): New APIColin Walters2013-05-092-0/+44
| | | | This is useful if anyone runs your binary directly.
* Include local allocation macros by defaultColin Walters2013-05-036-1/+9
| | | | | | | ...but still avoid using them in the other parts of libgsystem itself. The reason for this is that at least some of the code ideally would go upstream to glib where we can't use them, and downporting is so tedious.
* gsystem-log: Suppress code location from journalColin Walters2013-04-251-1/+4
| | | | Since we're wrapping it.
* gsystem-log.h: New structured logging APIColin Walters2013-04-234-0/+114
| | | | This is a wrapper for systemd-journal that's introspectable.
* fileutils: Initialize tryagain variable to pacify older GCC versionsColin Walters2013-04-231-1/+1
|
* shutil: rm_rf should delete symlinks to directories, not follow themColin Walters2013-03-011-8/+27
| | | | Like coreutils does.
* fileutils: Fix logic error caught by compilerColin Walters2013-02-261-2/+1
| | | | We want to actually propagate the "try again" bits...
* GSSubprocess: Correctly close pipefd in parentColin Walters2013-01-304-14/+21
| | | | Otherwise we leak...
* GSSubprocess: New API to allocate a separate pipe between parent and childColin Walters2013-01-264-10/+159
| | | | This is useful when reading structured data from the child.
* fileutils: Don't loop for EINTR on close()Colin Walters2013-01-251-3/+7
| | | | See https://bugzilla.gnome.org/show_bug.cgi?id=682819
* GSConsole: Fix infinite loopColin Walters2013-01-241-0/+1
|
* GSConsole: New API to access system consoleColin Walters2013-01-244-0/+503
| | | | At present, only implemented for Unix.
* Decouple gsystem-local-alloc from libgsystem.hColin Walters2013-01-233-106/+179
| | | | | I'd like some of the code here to possibly make its way into GLib. In order to accomplish that, we can't use the local allocation macros =/
* Revert "gsystemlog.la: New library which wraps sd_journal"Colin Walters2013-01-155-241/+0
| | | | | | | | This reverts commit 7229abafe3f8fac571cc1032dbfa16fce8954ade. After some discussion here: https://bugzilla.gnome.org/show_bug.cgi?id=691785 and in person, Ray and I decided to not have a generic systemd/syslog wrapper here.
* gsystemlog.la: New library which wraps sd_journalColin Walters2013-01-135-0/+241
| | | | | | An experimental API which allows logging to systemd. It's is simpler for the case where you just want a MESSAGE_ID+MESSAGE+PRIORITY (very common), and also can fallback to syslog if systemd isn't available.
* fileutils: Fix incorrect parameter to lstat()Colin Walters2013-01-081-1/+1
|
* fileutils: Consistently handle errno -> errorColin Walters2013-01-081-33/+19
| | | | | We expect callers to prefix the errors with any relevant information on their own, for now.
* shutil: Allow gs_shutil_rm_rf() to delete files tooColin Walters2013-01-071-0/+7
| | | | It was documented to do so.
* fileutils: Extend linkcopy APIColin Walters2013-01-062-22/+116
| | | | | * Add gs_file_linkcopy() * Honor some GFileCopyFlags (namely G_FILE_COPY_OVERWRITE)