Commit graph

126 commits

Author SHA1 Message Date
Maarten Bosmans
33a88fbfde Get rid of some warnings: -Wunused-result
modules/module-default-device-restore.c: In function ‘load’:
modules/module-default-device-restore.c:67: warning: ignoring return value of ‘fgets’,
declared with attribute warn_unused_result [-Wunused-result]
modules/module-default-device-restore.c:88: warning: ignoring return value of ‘fgets’,
declared with attribute warn_unused_result [-Wunused-result]

pulsecore/authkey.c: In function ‘generate’:
pulsecore/authkey.c:58: warning: ignoring return value of ‘ftruncate’,
declared with attribute warn_unused_result [-Wunused-result]

pulsecore/core-util.c: In function ‘pa_make_secure_dir’:
pulsecore/core-util.c:261: warning: ignoring return value of ‘fchown’,
declared with attribute warn_unused_result [-Wunused-result]
2011-03-20 11:22:28 +00:00
Colin Guthrie
d7ce59de88 Merge remote-tracking branch 'mkbosmans/mingw32-build' 2011-03-20 11:18:19 +00:00
Maarten Bosmans
eb833da570 Find modules and config files relative to the installed libraries.
Do not use replace %PULSE_ROOT% from the environment.
2011-03-19 13:38:37 +01:00
Maarten Bosmans
684b89c639 Fix up some double spaces 2011-03-18 09:20:07 +00:00
Maarten Bosmans
ecf09f2cd6 Fix up according to Coding Style
Only whitespace changes in here
2011-03-11 11:49:35 +00:00
Maarten Bosmans
53695b83dc Get rid of some unused-function compiler warnings 2011-03-02 14:52:46 +00:00
Maarten Bosmans
a39a83665f win32: Implement rtclock based on QueryPerformanceCounter
Also remove some unnecessary <time.h> headers.
2011-02-17 12:02:31 +01:00
Maarten Bosmans
d6d4336705 Implement some functions for win32
And disable building binaries for win32 that make no sense there
2011-02-17 12:02:30 +01:00
Maarten Bosmans
7b90e3b942 Repair some typos 2011-02-17 12:02:30 +01:00
Maarten Bosmans
2de2c735c9 Fix dependencies and include necessary headers 2011-02-17 11:58:22 +01:00
Maarten Bosmans
a951c779c6 Use PCRE if POSIX regex.h is not available 2011-02-17 11:58:22 +01:00
Maarten Bosmans
bb12ff8356 Apply #ifdefs around functionality not available on win32
And also the reverse: around some win32 specific functionality
2011-02-17 11:58:22 +01:00
Maarten Bosmans
4f1d4044f8 Use <pulsecore/socket.h> instead of <sys/socket.h>
The check whether POSIX socket.h or WIN32 winsock2.h must be included can be
made centrally.  The downside is that some functionality of e.g. arpa/inet.h is
also implemented in winsock.h, so that some files that don't use socket
functions, but do use inet.h functions, must also include pulsecore/socket.h.
(as well as arpa/inet.h)
2011-02-17 11:58:21 +01:00
Maarten Bosmans
8d12ab9e63 Use setenv instead of putenv
In theory putenv could be used to handle freeing of strings yourself, but this
was not done in PulseAudio.  That leaves no advantages in using putenv.  With
setenv you're at the mercy of the implementation whether the strings leak, but
at least that is better then a certain leak, as it was before.
2011-02-17 11:58:21 +01:00
Scott Reeves
a509f10f95 Core: Fix incorrect check of return value 2011-01-23 14:10:49 +00:00
Kees Cook
87fdbb544b core-util: ensure that we chmod only the dir we ourselves created 2010-05-08 14:19:08 +01:00
Lennart Poettering
f1af7a02d1 core-util: introduce generic function pa_strip() 2010-02-21 21:59:53 +01:00
Daniel Mack
937c587e77 fix a number of warnings
most of them were due to missing #ifdefs or wrong printf format type for
[s]size_t.
2010-01-05 22:46:13 +01:00
Lennart Poettering
2294642762 core: make cpuid code compile cleanly with 32bit PIC 2009-11-11 04:50:32 +01:00
Lennart Poettering
642c69bed8 core-util: add call to detect if we are called from within a VM 2009-11-05 03:22:15 +01:00
Lennart Poettering
8e94f65348 daemon: make sure pa has its own session and process group, but is not its leader so that we cannot acquire a tty ever 2009-10-31 02:43:47 +01:00
Lennart Poettering
168be3830a use pa_fopen_cloexec() where applicable 2009-10-30 04:54:19 +01:00
Lennart Poettering
752727a13d core-util: introduce pa_fopen_cloexec() 2009-10-30 04:20:24 +01:00
Lennart Poettering
a698ee3f52 core-util: make sure to enable FD_CLOEXEC unconditionally to cope with kernels that silently accept but ignore O_CLOEXEC 2009-10-30 04:16:59 +01:00
Lennart Poettering
65e7bc18a9 use cloexec wrappers wherever applicable 2009-10-30 03:32:38 +01:00
Lennart Poettering
9c1a98953f core-util: introduce FD_CLOEXEC wrappers for open/socket/pipe/accept 2009-10-30 03:30:42 +01:00
Tanu Kaskinen
019331d25b Merge branch 'master' into dbus-work
Conflicts:
	src/daemon/daemon-conf.c
2009-10-02 17:24:44 +03:00
Lennart Poettering
7b76ea3784 core-util: unify how we determine the temporary directory 2009-09-17 21:06:54 +02:00
Lennart Poettering
2d9168ceb3 Improve TMPDIR handling
Patch from 'jnelson',

http://pulseaudio.org/ticket/653
2009-09-17 20:58:36 +02:00
Lennart Poettering
31ae7deefa core-util: properly fill in exception array for pa_reset_sigs() (llvm-clang-analyzer) 2009-09-08 23:52:58 +02:00
Lennart Poettering
f5046759cd llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixes 2009-09-08 23:46:23 +02:00
Lennart Poettering
51fc1763a1 Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio 2009-09-02 04:06:04 +02:00
Lennart Poettering
297afadbef core-util: don't leak memory in pa_unset_env_recorded() 2009-09-02 04:05:34 +02:00
Lennart Poettering
767c7c7cf4 core-util: call dbus_connection_set_exit_on_disconnect() on shared busses to make sure dbus_shutdown() isn't fatal 2009-09-02 04:03:18 +02:00
Lennart Poettering
5f929963d1 core-util: add api for setting env vars and record them so that we can undo them n fork 2009-09-02 00:34:27 +02:00
Tanu Kaskinen
0ad2d55cbe Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/modules/module-stream-restore.c
2009-08-30 20:07:31 +03:00
Andy Shevchenko
ae383539d7 core-util: Fix logic of pa_make_path_absolute()
Make it works as described in commentary (when fn is NULL, pa_assert(fn) could
break logic).
2009-08-28 17:12:26 +02:00
Tanu Kaskinen
2f3fc2f1d6 Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/Makefile.am
2009-08-24 14:43:11 +03:00
Lennart Poettering
a0f01ddc95 port a few things over to use xmalloc and friends instead of low-level libc malloc/free directly 2009-08-23 21:49:37 +02:00
Ted Percival
15eb03a5b3 core: Add thread-safe group info functions with dynamic buffers
Provides getgrgid, getgrnam, getpwuid & getpwnam replacements that are
thread safe (a la getgrgid_r() and friends) that internally
handle allocating big-enough buffers to avoid ERANGE errors
on large users or groups.
2009-08-22 00:53:39 +02:00
Lennart Poettering
8a2a6b2004 adjust various data/library paths automatically if we are run from a build tree 2009-08-21 03:43:53 +02:00
Lennart Poettering
c5bd72509e core: check return value of getgrnam_r() instead of errno
According to POSIX getgrnam_r() returns the error code as return value,
and not in errno. Honour that.

Pointed out and inspired by a patch from Ted Percival.
2009-08-20 00:20:03 +02:00
Tanu Kaskinen
bcaba0b1b4 Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
	src/Makefile.am
	src/daemon/daemon-conf.c
	src/daemon/daemon.conf.in
	src/modules/module-stream-restore.c
	src/pulse/client-conf.c
	src/pulsecore/namereg.c
2009-08-16 21:25:48 +03:00
Lennart Poettering
ef176ecb62 core-util: move personality resetting into core-util 2009-08-12 21:36:52 +02:00
Lennart Poettering
49fd8ee72e core-util: replace remaining fixed size destination string functions by _malloc() versions
This helps portability to GNU/Hurd.

Patch originally from Samuel Thibault but modified.

Closes ticket #546
2009-08-01 02:03:22 +02:00
Lennart Poettering
c6ea9fecc9 core-util: rework pa_strlcpy() to not rely on strncpy()
strncpy() is very slow since it resets the entire destination buffer.
Replace usage of strncpy by memcpy().
2009-08-01 02:01:58 +02:00
Lennart Poettering
e5c2256e36 pipe: replace PIPE_BUF macro pa pa_pipe_buf call
This should help portability to platforms that lack PIPE_BUF. Based on a
patch from Samuel Thibault.

See ticket #546
2009-08-01 01:59:58 +02:00
Lennart Poettering
5a0ef5fd13 daemon: replace colons by dash in per-machine directory names for compat with weird filesystems 2009-07-23 19:12:53 +02:00
Tanu Kaskinen
9347e90fed Finish the Core dbus interface. 2009-07-21 00:02:27 +03:00
Diego Elio 'Flameeyes' Pettenò
1ca7603109 Add missing headers includes for FreeBSD.
This removes the implicit declarations of send() and pthread_sigmask().
2009-06-29 17:42:07 +02:00