diff options
author | Marcus Brinkmann <mb@g10code.com> | 2009-08-26 18:36:49 +0000 |
---|---|---|
committer | Marcus Brinkmann <mb@g10code.com> | 2009-08-26 18:36:49 +0000 |
commit | bca49a41bfb5d3f1e8ce7412d15a865cfc482516 (patch) | |
tree | 5066bcc8971f3cdc1c97d17709c0e578eb4817e0 /tests | |
parent | 5809572eed9ac2ed694317e036a3cead8e8946d1 (diff) | |
download | libassuan-bca49a41bfb5d3f1e8ce7412d15a865cfc482516.tar.gz |
2009-08-26 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Test for versioned symbols support.
(LIBASSUAN_LT_CURRENT, LIBASSUAN_LT_AGE)
(LIBASSUAN_LT_REVISION): New, set to 0.
(LIBASSUAN_CONFIG_API_VERSION): Bump to 2.
(AC_CONFIG_MACRO_DIR, AC_DISABLE_STATIC, AC_LIBTOOL_WIN32_DLL)
(AC_LIBTOOL_RC, AC_PROG_LIBTOOL, AM_PATH_GPG_ERROR): Invoke.
(AC_PROG_RANLIB): Don't invoke.
(HAVE_W32_SYSTEM): New AM conditional.
(AC_CONFIG_FILES): Add src/versioninfo.rc.
* ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4,
m4/ltversion.m4, m4/lt~obsolete.m4: New files from libtool 2.2.6.
* tests/Makefile.am (AM_CFLAGS, LDADD): Add gpg-error.
* tests/fdpassing.c: Change error values to gpg-error ones.
src/
2009-08-26 Marcus Brinkmann <marcus@g10code.de>
* libassuan-config.in: Add gpg-error.
* assuan-buffer.c, assuan-inquire.c, assuan-handler.c,
assuan-util.c, assuan-client.c, assuan-socket-connect.c,
assuan-pipe-connect.c, assuan-defs.h, assuan-socket.c,
assuan-connect.c, assuan-uds.c, assuan-socket-server.c,
assuan-listen.c, assuan-pipe-server.c: Return gpg_error_t instead
assuan_error_t everywhere. Return gpg error codes everywhere.
Replace xtrymalloc, xfree, etc with _assuan_malloc, _assuan_free
etc. Protect include <config.h> by HAVE_CONFIG_H where not done
so already.
* versioninfo.rc.in, libassuan.vers, libassuan.def,
assuan-error.c: New files.
* Makefile.am: Add libtool handling and gpg-error (also for W32).
(EXTRA_DIST): Remove mkerrors, add libassuan.vers,
versioninfo.rc.in and libassuan.def.
(BUILT_SOURCES, MOSTLYCLEANFILES): Removed.
(common_sources): Remove assuan-errors.c, add assuan-error.c.
* assuan.h: Include <gpg-error.h>.
[_ASSUAN_ONLY_GPG_ERRORS]: Feature removed.
(assuan_init_connected_socket_server, assuan_strerror)
(assuan_pipe_connect2): Removed obsolete interfaces.
(assuan_error_t): Removed type.
(assuan_flag_t): Changed from enum to unsigned int.
(ASSUAN_NO_WAITPID, ASSUAN_CONFIDENTIAL): Changed from enum to macro.
(assuan_process): Return gpg_error_t instead of int.
(assuan_set_assuan_err_source): Change argument type from int to
gpg_err_source_t.
* assuan-defs.h (_assuan_error): Change types to gpg_error_t.
(err_code, err_is_eof, xtrymalloc, xtrycalloc, xtryrealloc)
(xfree): Removed.
(set_error): Adjust for gpg-error codes.
(_assuan_gpg_strerror_r, _assuan_gpg_strsource): Removed.
(struct assuan_context_s): Remove member os_errno.
* assuan-socket-server.c (accept_connection): Don't set CTX->os_errno.
* mkerrors: Removed file.
* assuan-io-pth.c (_assuan_simple_sendmsg)
(_assuan_simple_recvmsg), assuan-io.c (_assuan_simple_sendmsg,
_assuan_simple_recvmsg): Set errno instead returning error
directly (and return -1).
* assuan-handler.c (assuan_process_done): Remove handling for old
style error values.
(process_request, assuan_process): Change return type from int to
gpg_error_t.
* assuan-client.c (assuan_transact): Remove support for old style
error values.
* assuan-pipe-connect.c (assuan_pipe_connect2): Removed.
* assuan-logging.c (my_strerror_r, my_strsource)
(load_libgpg_error, _assuan_gpg_strerror_r)
(_assuan_gpg_strsource): Removed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/fdpassing.c | 58 |
2 files changed, 31 insertions, 31 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 3271451..5d512c2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,9 +31,9 @@ if USE_DESCRIPTOR_PASSING TESTS += fdpassing endif -AM_CFLAGS = # $(GPG_ERROR_CFLAGS) +AM_CFLAGS = $(GPG_ERROR_CFLAGS) noinst_HEADERS = common.h noinst_PROGRAMS = $(TESTS) -LDADD = ../src/libassuan.a $(NETLIBS) # $(GPG_ERROR_LIBS) +LDADD = ../src/libassuan.la $(NETLIBS) $(GPG_ERROR_LIBS) diff --git a/tests/fdpassing.c b/tests/fdpassing.c index df4dfb7..fa26353 100644 --- a/tests/fdpassing.c +++ b/tests/fdpassing.c @@ -1,20 +1,20 @@ /* fdpassing - Check the fiel descriptor passing. - * Copyright (C) 2006 Free Software Foundation, Inc. - * - * This file is part of Assuan. - * - * Assuan is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * Assuan is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see <http://www.gnu.org/licenses/>. + Copyright (C) 2006, 2009 Free Software Foundation, Inc. + + This file is part of Assuan. + + Assuan is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of + the License, or (at your option) any later version. + + Assuan is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> @@ -37,7 +37,7 @@ */ -static int +static gpg_error_t cmd_echo (assuan_context_t ctx, char *line) { int fd; @@ -49,12 +49,12 @@ cmd_echo (assuan_context_t ctx, char *line) fd = assuan_get_input_fd (ctx); if (fd == -1) - return ASSUAN_No_Input; + return gpg_error (GPG_ERR_ASS_NO_INPUT); fp = fdopen (fd, "r"); if (!fp) { log_error ("fdopen failed on input fd: %s\n", strerror (errno)); - return ASSUAN_General_Error; + return gpg_error (GPG_ERR_ASS_GENERAL); } nbytes = 0; while ( (c=getc (fp)) != -1) @@ -69,7 +69,7 @@ cmd_echo (assuan_context_t ctx, char *line) return 0; } -static assuan_error_t +static gpg_error_t register_commands (assuan_context_t ctx) { static struct @@ -84,7 +84,7 @@ register_commands (assuan_context_t ctx) { NULL, NULL } }; int i; - assuan_error_t rc; + gpg_error_t rc; for (i=0; table[i].name; i++) { @@ -106,11 +106,11 @@ server (void) rc = assuan_init_pipe_server (&ctx, NULL); if (rc) - log_fatal ("assuan_init_pipe_server failed: %s\n", assuan_strerror (rc)); + log_fatal ("assuan_init_pipe_server failed: %s\n", gpg_strerror (rc)); rc = register_commands (ctx); if (rc) - log_fatal ("register_commands failed: %s\n", assuan_strerror(rc)); + log_fatal ("register_commands failed: %s\n", gpg_strerror(rc)); assuan_set_log_stream (ctx, stderr); @@ -120,7 +120,7 @@ server (void) if (rc) { if (rc != -1) - log_error ("assuan_accept failed: %s\n", assuan_strerror (rc)); + log_error ("assuan_accept failed: %s\n", gpg_strerror (rc)); break; } @@ -129,7 +129,7 @@ server (void) rc = assuan_process (ctx); if (rc) - log_error ("assuan_process failed: %s\n", assuan_strerror (rc)); + log_error ("assuan_process failed: %s\n", gpg_strerror (rc)); } assuan_deinit_server (ctx); @@ -169,7 +169,7 @@ client (assuan_context_t ctx, const char *fname) rc = assuan_sendfd (ctx, fileno (fp)); if (rc) { - log_error ("assuan_sendfd failed: %s\n", assuan_strerror (rc)); + log_error ("assuan_sendfd failed: %s\n", gpg_strerror (rc)); return -1; } fclose (fp); @@ -178,14 +178,14 @@ client (assuan_context_t ctx, const char *fname) NULL, NULL); if (rc) { - log_error ("sending INPUT FD failed: %s\n", assuan_strerror (rc)); + log_error ("sending INPUT FD failed: %s\n", gpg_strerror (rc)); return -1; } rc = assuan_transact (ctx, "ECHO", NULL, NULL, NULL, NULL, NULL, NULL); if (rc) { - log_error ("sending ECHO failed: %s\n", assuan_strerror (rc)); + log_error ("sending ECHO failed: %s\n", gpg_strerror (rc)); return -1; } } @@ -283,7 +283,7 @@ main (int argc, char **argv) no_close_fds, NULL, NULL, 1); if (err) { - log_error ("assuan_pipe_connect failed: %s\n",assuan_strerror (err)); + log_error ("assuan_pipe_connect failed: %s\n", gpg_strerror (err)); return 1; } |