Fixed couple of build problems. However the W32 version is currently

under work.
This commit is contained in:
Werner Koch 2010-07-26 14:27:59 +00:00
parent ca279dc707
commit 5b664bed4f
3 changed files with 17 additions and 15 deletions

View File

@ -3412,18 +3412,18 @@ es_set_binary (estream_t stream)
{
stream->intern->modeflags |= O_BINARY;
#ifdef HAVE_DOSISH_SYSTEM
if (stream->intern->func_dest.func_read == es_func_fd_read)
if (stream->intern->func_read == es_func_fd_read)
{
estream_cookie_fd_t fd_cookie;
estream_cookie_fd_t fd_cookie = stream->intern->cookie;
if (!IS_INVALID_FD (fd_cookie->fd))
setmode (fd, O_BINARY);
setmode (fd_cookie->fd, O_BINARY);
}
else if (stream->intern->func_dest.func_read == es_func_fp_read)
else if (stream->intern->func_read == es_func_fp_read)
{
estream_cookie_fp_t fp_cookie;
estream_cookie_fp_t fp_cookie = stream->intern->cookie;
if (fp_cookie->fd)
if (fp_cookie->fp)
setmode (fileno (fp_cookie->fp), O_BINARY);
}
#endif

View File

@ -135,7 +135,7 @@ struct my_opt_s
char *filter;/* Override filter. */
char *attr; /* Override attribute. */
};
typedef struct my_opt_s my_opt_t;
typedef struct my_opt_s *my_opt_t;
/* Prototypes. */
@ -357,7 +357,7 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
if (myopt->multi)
{ /* Write item marker. */
if (es_fwrite ("I\0\0\0\0", 5, 1, myopt->oustream) != 1)
if (es_fwrite ("I\0\0\0\0", 5, 1, myopt->outstream) != 1)
{
log_error (_("error writing to stdout: %s\n"),
strerror (errno));
@ -434,8 +434,8 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
tmp[2] = (n >> 16);
tmp[3] = (n >> 8);
tmp[4] = (n);
if (es_fwrite (tmp, 5, 1, myopt->oustream) != 1
|| es_fwrite (attr, n, 1, myopt->oustream) != 1)
if (es_fwrite (tmp, 5, 1, myopt->outstream) != 1
|| es_fwrite (attr, n, 1, myopt->outstream) != 1)
{
log_error (_("error writing to stdout: %s\n"),
strerror (errno));
@ -459,7 +459,7 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
tmp[3] = (n >> 8);
tmp[4] = (n);
if (es_fwrite (tmp, 5, 1, myopt->oustream) != 1)
if (es_fwrite (tmp, 5, 1, myopt->outstream) != 1)
{
log_error (_("error writing to stdout: %s\n"),
strerror (errno));
@ -475,7 +475,7 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
CRLs which are 52 KB or larger. */
#warning still true - implement in estream
if (es_fwrite (values[0]->bv_val, values[0]->bv_len,
1, myopt->oustream) != 1)
1, myopt->outstream) != 1)
{
log_error (_("error writing to stdout: %s\n"),
strerror (errno));
@ -498,7 +498,7 @@ print_ldap_entries (my_opt_t myopt, LDAP *ld, LDAPMessage *msg, char *want_attr)
cnt = MAX_CNT;
if (es_fwrite (((char *) values[0]->bv_val) + n, cnt, 1,
myopt->oustream) != 1)
myopt->outstream) != 1)
{
log_error (_("error writing to stdout: %s\n"),
strerror (errno));
@ -617,7 +617,7 @@ fetch_ldap (my_opt_t myopt, const char *url, const LDAPURLDesc *ludp)
&myopt->timeout, &msg);
if (rc == LDAP_SIZELIMIT_EXCEEDED && myopt->multi)
{
if (es_fwrite ("E\0\0\0\x09truncated", 14, 1, myopt->oustream) != 1)
if (es_fwrite ("E\0\0\0\x09truncated", 14, 1, myopt->outstream) != 1)
{
log_error (_("error writing to stdout: %s\n"), strerror (errno));
return -1;

View File

@ -20,6 +20,8 @@
#ifndef LDAP_WRAPPER_H
#define LDAP_WRAPPER_H
#include <ksba.h>
/* ldap-wrapper.c or ldap-wrapper-ce.c */
void ldap_wrapper_launch_thread (void);
void ldap_wrapper_wait_connections (void);
@ -31,7 +33,7 @@ gpg_error_t ldap_wrapper (ctrl_t ctrl, ksba_reader_t *reader,
/* dirmngr_ldap.c */
#ifndef USE_LDAPWRAPPER
int ldap_wrapper_main (int argc, char **argv, estream_t outstream);
int ldap_wrapper_main (char **argv, estream_t outstream);
#endif