diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-02-24 16:27:39 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-02-24 16:27:39 +0000 |
commit | 9f1b79368909a57a9de40f98dacd306e15bda3bc (patch) | |
tree | 30a413327d21d7cc0fc26f46615d230c8dac6d15 /src | |
parent | 3f264b2c4acfaaf8dd9c6b05526708a1d7648db0 (diff) |
Tweak the handling of missing credential support so that we minimise non-POSIX
headers in our headers.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@597 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
-rw-r--r-- | src/polypcore/iochannel.c | 29 | ||||
-rw-r--r-- | src/polypcore/iochannel.h | 6 |
2 files changed, 30 insertions, 5 deletions
diff --git a/src/polypcore/iochannel.c b/src/polypcore/iochannel.c index ea0ac988..5da7a9a9 100644 --- a/src/polypcore/iochannel.c +++ b/src/polypcore/iochannel.c @@ -29,6 +29,13 @@ #include <unistd.h> #include <errno.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_SYS_UN_H +#include <sys/un.h> +#endif + #include "winsock.h" #include <polypcore/util.h> @@ -370,7 +377,27 @@ ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, struc return r; } -#endif +#else /* SCM_CREDENTIALS */ + +int pa_iochannel_creds_supported(pa_iochannel *io) { + return 0; +} + +int pa_iochannel_creds_enable(pa_iochannel *io) { + return -1; +} + +ssize_t pa_iochannel_write_with_creds(pa_iochannel*io, const void*data, size_t l) { + pa_log_error("pa_iochannel_write_with_creds() not supported."); + return -1; +} + +ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, struct ucred *ucred, int *creds_valid) { + pa_log_error("pa_iochannel_read_with_creds() not supported."); + return -1; +} + +#endif /* SCM_CREDENTIALS */ void pa_iochannel_set_callback(pa_iochannel*io, pa_iochannel_cb_t _callback, void *userdata) { assert(io); diff --git a/src/polypcore/iochannel.h b/src/polypcore/iochannel.h index 617ce086..fe7cc0ce 100644 --- a/src/polypcore/iochannel.h +++ b/src/polypcore/iochannel.h @@ -23,8 +23,6 @@ ***/ #include <sys/types.h> -#include <sys/socket.h> -#include <sys/un.h> #include <polyp/mainloop-api.h> @@ -51,13 +49,13 @@ void pa_iochannel_free(pa_iochannel*io); ssize_t pa_iochannel_write(pa_iochannel*io, const void*data, size_t l); ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l); -#ifdef SCM_CREDENTIALS int pa_iochannel_creds_supported(pa_iochannel *io); int pa_iochannel_creds_enable(pa_iochannel *io); +struct ucred; + ssize_t pa_iochannel_write_with_creds(pa_iochannel*io, const void*data, size_t l); ssize_t pa_iochannel_read_with_creds(pa_iochannel*io, void*data, size_t l, struct ucred *ucred, int *creds_valid); -#endif int pa_iochannel_is_readable(pa_iochannel*io); int pa_iochannel_is_writable(pa_iochannel*io); |