| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
--
Signed-off-by: Justus Winter <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gen-posix-lock-obj.c: properly guard inclusioin of pthread.h
* tests/t-lock.c: likewise
* tests/t-poll.c: likewise
--
Although ./configure checks for thread support, gen-posix-lock-obj and
two tests still include pthread.h unconditionally.
Guard that inclusion using the same condition as all other uses of
pthread-related code.
Signed-off-by: "Yann E. MORIN" <[email protected]>
|
|
|
|
|
|
|
|
| |
* tests/t-poll.c (launch_thread): Use es_fileno before starting the
thread.
--
GnuPG-bug-id: 2257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--
* use https for bug reporting
* in comments and docs, use https to refer to:
- www.gnu.org
- creativecommons.org
- translationproject.org
- mail.gnome.org
- www.perl.org
- www.ctan.org
- www.cl.cam.ac.uk
- www.ntg.nl
- cygwin.com
- www.ethnologue.com
|
|
|
|
|
|
|
|
| |
* tests/t-poll.c (test_poll): Fix read past buffer.
--
Found using gcc and AddressSanitizer.
Signed-off-by: Justus Winter <[email protected]>
|
|
|
|
|
| |
--
Signed-off-by: Justus Winter <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (AC_CHECK_HEADERS): Add sys/select.h and sys/time.h.
* src/estream.c: Include both header if available.
(COOKIE_IOCTL_NONBLOCK): New.
(struct estream_cookie_fd): Add field nonblock.
(func_fd_create): Set nonblock from MODEFLAGS.
(es_func_fd_ioctl): New.
(parse_mode): Add modeflag "nonblock".
(es_fill): Map EWOULDBLOCK to EAGAIN. Do not set error indicator for
EAGAIN.
(es_flush, es_seek, es_write_nbf): Map EWOULDBLOCK to EAGAIN.
(do_fdopen): Call COOKIE_IOCTL_NONBLOCK.
(_gpgrt_set_nonblock): New.
(_gpgrt_get_nonblock): New.
(_gpgrt_poll): New.
* src/gpg-error.h.in (struct _gpgrt_poll_s): New.
(gpgrt_poll_t, es_poll_t): New.
(es_set_nonblock, es_get_nonblock, es_poll): New.
* src/gpg-error.vers, src/gpg-error.def.in: Add gpgrt_set_nonblock,
gpgrt_get_nonblock, and gpgrt_poll.
* src/visibility.c (gpgrt_set_nonblock, gpgrt_get_nonblock): New.
(gpgrt_poll): New.
* tests/t-common.h (DIM): New.
* tests/t-poll.c: New.
* tests/Makefile.am (TESTS): Add t-poll.
(t_poll_LDADD): New.
--
The poll interface uses select(2) internally because that is more
portable than poll(2).
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/posix-lock-obj.h (LOCK_ABI_NOT_AVAILABLE): New.
(LOCK_ABI_VERSION): Define depending on USE_POSIX_THREADS.
(_gpgrt_lock_t) [!USE_POSIX_THREADS]: Do not define the union.
* src/gen-posix-lock-obj.c: Take care of USE_POSIX_THREADS.
* src/posix-lock.c (_gpgrt_lock_init, _gpgrt_lock_lock)
(_gpgrt_lock_trylock, _gpgrt_lock_unlock)
(_gpgrt_lock_destroy): Return success for a no-threads version.
* tests/t-lock.c: Disable tests if threads are not available.
* src/mkheader.c (main): Add NO-THREADS to the printed comment.
* configure.ac: Show NO-TRHEADS in the final summary.
--
Warning: Using --disable-threads creates a different ABI which we
can't encode in the the cpu-vendor-os triplet. The run time checks
should detect this and abort the process.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/Makefile.am (pre_mkheader_cmds): Avoid make diagnostic about
failed but ignored command. This confuses Emacs' compiler job parser.
* tests/t-lock.c [W32]: Include time.h.
* src/init.c: Reorganize Windows only code.
(wchar_to_utf8, utf8_to_wchar): Remove unused functions.
(_gpg_err_set_errno): Use only one copy for all platforms.
--
Note that there is a still a problem for W64 pertaining to the use of
an int to store a HANDLE. This will be fixed when we add a full
abstraction layer for Windows file objects.
|
|
|
|
|
|
|
| |
* configure.ac (AM_INIT_AUTOMAKE): Add serial-tests.
* tests/Makefile.am (INCLUDES): Replace by AM_CPPFLAGS.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/t-printf.c: New.
* configure.ac: Check for vasprintf.
--
These tests have been taken from Libestream and changed to be more
portable. For example there is only va_start per function and the
test return an error only for _GLIBC_ based systems because that is
what we compare against.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: New option --enable-ld-version-script.
(GPGRT_USE_VISIBILITY): New ac_define.
(HAVE_LD_VERSION_SCRIPT): New am_conditional.
* src/gpg-error.vers: New.
* src/gpgrt-int.h: New.
* src/visibility.c, src/visibility.h: New. Lot of changes to symbold
names.
--
This is only doe for the old API. The estream API needs to be added.
|
| |
|
|
|
|
|
|
|
|
|
| |
* tests/t-lock.c: Include header vor getpid.
(revision_thread): Init "i" to avoid compiler warning.
--
GnuPG-bug-id: 1681
Note that the non-initialization of I did not harm.
|
|
|
|
| |
* tests/t-version.c (main): Print program name.
|
|
|
|
| |
* tests/t-lock.c (accountant_thread) [W32]: Call srand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.h.in (GPGRT_LOCK_DEFINE): New.
(gpgrt_lock_init): New.
(gpgrt_lock_lock): New.
(gpgrt_lock_unlock): New.
(gpgrt_lock_destroy): New.
(gpgrt_yield): New.
* src/gpg-error.def.in: Add new functions.
* m4/lock.m4, m4/threadlib.m4: New. Taken from current gnulib.
* configure.ac: Call gl_LOCK. Check size of pthread_mutex_t. Add
LIBTHREAD to GPG_ERROR_CONFIG_LIBS.
* src/err-codes.h.in (GPG_ERR_INV_LOCK_OBJ): New.
* src/gen-posix-lock-obj.c: New.
* src/gen-w32-lock-obj.c: New.
* src/lock.h, src/thread.h: New.
* src/posix-lock-obj.h, src/w32-lock-obj.h: New.
* src/posix-lock.c, src/w32-lock.c: New.
* src/posix-thread.c, src/w32-thread.c:
* src/w32-lock-obj-pub.in: New.
* src/mkheader.c (include_file): Support build time include files.
(write_special): Add keyword "include:lock-obj".
* src/Makefile.am:
(posix-lock-obj-pub.in): New rule.
(noinst_PROGRAMS): Add gen-*-lock-obj helpers.
* tests/t-common.h: New.
* tests/t-lock.c: New.
* tests/Makefile.am (t_lock_LDADD): Add new test.
--
This patch introduces the gpgrt_ functions which will be extended over
time to provide a library of commonly used code in GnuPG and
Libgcrypt. Having them in a library named libgpg-error is a misnomer
but this way we can achieve a smooth upgrade path.
In contrasts to other GnuPG libraries, the gpgrt_ functions return a
simple gpg_err_code_t and not gpg_error_t. The rationale for this is
that a source of error identifier does not make sense here; it is
better to use the source of error identifier of the caller. This can
easily be achieved in a component by wrapping these function in a
gpg_error macro/inline.
There is no cross-compiling support for Posix platforms; the
gen-posix-lock-obj tool must be run on the target system.
Note that the gen-w32-lock-obj tool is not needed at build time but
was used to figure out ABI definitions for Windows.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (VERSION_NUMBER): New ac_subst.
(BUILD_FILEVERSION): Build on all platforms
(BUILD_TIMESTAMP): Try to use an ISO string.
* src/Makefile.am (extra-h.in): Add new version numbers.
* src/versioninfo.rc.in: Update copyright year.
* src/version.c: New.
(gpg_error_check_version): New API.
* src/gpg-error.h.in: Add gpg_error_check_version prototype.
* src/gpg-error.def.in: Add gpg_error_check_version
* tests/t-version.c: New.
* tests/Makefile.am (TESTS): Add t-version.c
* src/gpg-error-config.in: s/VERSION/PACKAGE_VERSION/.
--
All other GnuPG libraries do this, thus we do it here as well.
|
| |
|
| |
|
|
|
|
|
|
| |
* tests/Makefile.am (INCLUDES): Change to -I$(top_srcdir)/src to
-I$(top_builddir).
|
|
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.h (gpg_err_code_t): Add GPG_ERR_INV_ENGINE,
GPG_ERR_PUBKEY_NOT_TRUSTED, GPG_ERR_DECRYPT_FAILED,
GPG_ERR_KEY_EXPIRED.
(gpg_make_error): Rename to gpg_err_make.
(gpg_error): Use here.
* tests/t-strerror.c (main): And here.
(gpg_make_error_from_errno): Rename to gpg_err_make_from_errno.
|
|
|
|
|
|
| |
* tests/t-strerror.c: Include <gpg-error.h> instead of
<gpg/error.h>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/mkstrtable.awk: Add exception clause to license about the
output of the script.
* configure.ac: Change license to LGPL 2.1 or later.
* Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* src/err-codes.h.in: Likewise.
* src/err-sources.h.in: Likewise.
* src/strsource.c: Likewise.
* src/strerror.c: Likewise.
* src/gpg/error.h: Likewise.
* tests/Makefile.am: Likewise.
* src/mkstrtable.awk: New variable HEADER. Copy input until first
line with an actual code and description occurs.
* src/err-codes.h.in: Uncomment license, so it is copied into the
output.
* src/err-sources.h.in: Likewise.
|
|
* Initial check-in.
|