* configure.ac: Require libgpg-error 1.8.
src/
2010-05-06 Marcus Brinkmann <marcus@g10code.de>
* sign.c, data-user.c, conversion.c, debug.c, verify.c, data.c,
decrypt.c, delete.c, assuan-support.c, import.c, engine-gpgsm.c,
data-mem.c, op-support.c, w32-io.c, w32-util.c, data-compat.c: Use
gpg_error_from_syserror instead gpg_error_from_errno, and use
gpg_err_set_errno to set error number.
* setenv.c: Include <gpg-error.h> and define __set_errno to use
gpg_err_set_errno.
* gpgme-tool.c (ARGP_ERR_UNKNOWN): Define to EDEADLOCK (which is
mapped in Windows CE) instead of E2BIG (which is not).
(gt_import_keys): Initialize err.
+2010-05-06 Marcus Brinkmann <marcus@g10code.de>
+
+ * configure.ac: Require libgpg-error 1.8.
+
2010-03-15 Werner Koch <wk@g10code.com>
* configure.ac (emacs_local_vars_begin)
Don't skip it - this is an important step!
To build GPGME, you need to install libgpg-error. You need at least
-libgpg-error 0.5.
+libgpg-error 1.8.
For support of the OpenPGP protocol (default), you should use the
latest version of GnuPG 1.2 or 1.4, available at:
fi
# Checking for libgpg-error.
-AM_PATH_GPG_ERROR(1.4,, AC_MSG_ERROR([libgpg-error was not found]))
+AM_PATH_GPG_ERROR(1.8,, AC_MSG_ERROR([libgpg-error was not found]))
AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
[The default error source for GPGME.])
int flags)
{
#ifdef HAVE_W32_SYSTEM
- errno = ENOSYS;
+ gpg_err_set_errno (ENOSYS);
return -1;
#else
return _gpgme_io_recvmsg (fd, msg, flags);
int flags)
{
#ifdef HAVE_W32_SYSTEM
- errno = ENOSYS;
+ gpg_err_set_errno (ENOSYS);
return -1;
#else
return _gpgme_io_sendmsg (fd, msg, flags);
if (! name)
{
- errno = ENOSYS;
+ gpg_err_set_errno (ENOSYS);
return -1;
}
int protocol, assuan_fd_t filedes[2])
{
#ifdef HAVE_W32_SYSTEM
- errno = ENOSYS;
+ gpg_err_set_errno (ENOSYS);
return -1;
#else
/* FIXME: Debug output missing. */
string. */
dest = malloc (strlen (src) + 1);
if (!dest)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
*destp = dest;
}
string. */
dest = malloc (strlen (src) + 1);
if (!dest)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
*destp = dest;
}
string. */
dest = malloc (destlen);
if (!dest)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
*destp = dest;
}
TRACE3 (DEBUG_DATA, "gpgme:gpgme_error_to_errno", 0,
"mapping %s <%s> to: %s", gpgme_strerror (err),
gpgme_strsource (err), strerror (res));
- errno = res;
+ gpg_err_set_errno (res);
return res ? -1 : 0;
}
if (whence != SEEK_SET || offset)
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return TRACE_SYSRES (-1);
}
err = (*dh->data.old_user.cb) (dh->data.old_user.handle, NULL, 0, NULL);
case SEEK_SET:
if (offset < 0 || offset > dh->data.mem.length)
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return -1;
}
dh->data.mem.offset = offset;
if ((offset > 0 && dh->data.mem.length - dh->data.mem.offset < offset)
|| (offset < 0 && dh->data.mem.offset < -offset))
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return -1;
}
dh->data.mem.offset += offset;
case SEEK_END:
if (offset > 0 || -offset > dh->data.mem.length)
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return -1;
}
dh->data.mem.offset = dh->data.mem.length - offset;
break;
default:
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return -1;
}
return dh->data.mem.offset;
{
if (!dh->data.user.cbs->read)
{
- errno = EBADF;
+ gpg_err_set_errno (EBADF);
return -1;
}
{
if (!dh->data.user.cbs->write)
{
- errno = EBADF;
+ gpg_err_set_errno (EBADF);
return -1;
}
{
if (!dh->data.user.cbs->seek)
{
- errno = EBADF;
+ gpg_err_set_errno (EBADF);
return -1;
}
*r_dh = NULL;
dh = calloc (1, sizeof (*dh));
if (!dh)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
dh->cbs = cbs;
if (!dh)
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return TRACE_SYSRES (-1);
}
if (!dh->cbs->read)
{
- errno = ENOSYS;
+ gpg_err_set_errno (ENOSYS);
return TRACE_SYSRES (-1);
}
do
if (!dh)
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return TRACE_SYSRES (-1);
}
if (!dh->cbs->write)
{
- errno = ENOSYS;
+ gpg_err_set_errno (ENOSYS);
return TRACE_SYSRES (-1);
}
do
if (!dh)
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return TRACE_SYSRES (-1);
}
if (!dh->cbs->seek)
{
- errno = ENOSYS;
+ gpg_err_set_errno (ENOSYS);
return TRACE_SYSRES (-1);
}
{
dh->file_name = strdup (file_name);
if (!dh->file_name)
- return TRACE_ERR (gpg_error_from_errno (errno));
+ return TRACE_ERR (gpg_error_from_syserror ());
}
else
dh->file_name = 0;
buflen = _gpgme_io_read (fd, buffer, BUFFER_SIZE);
if (buflen < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
if (buflen == 0)
{
_gpgme_io_close (fd);
{
ssize_t amt = gpgme_data_write (dh, bufp, buflen);
if (amt == 0 || (amt < 0 && errno != EINTR))
- return TRACE_ERR (gpg_error_from_errno (errno));
+ return TRACE_ERR (gpg_error_from_syserror ());
bufp += amt;
buflen -= amt;
}
{
ssize_t amt = gpgme_data_read (dh, dh->pending, BUFFER_SIZE);
if (amt < 0)
- return TRACE_ERR (gpg_error_from_errno (errno));
+ return TRACE_ERR (gpg_error_from_syserror ());
if (amt == 0)
{
_gpgme_io_close (fd);
}
if (nwritten <= 0)
- return TRACE_ERR (gpg_error_from_errno (errno));
+ return TRACE_ERR (gpg_error_from_syserror ());
if (nwritten < dh->pending_len)
memmove (dh->pending, dh->pending + nwritten, dh->pending_len - nwritten);
UNLOCK (debug_lock);
fflush (errfp);
- errno = saved_errno;
+ gpg_err_set_errno (saved_errno);
}
rec = malloc (sizeof (*rec));
if (!rec)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
rec->next = NULL;
rec->keyid = rec->_keyid;
if (*args)
{
- errno = 0;
+ gpg_err_set_errno (0);
rec->pubkey_algo = strtol (args, &tail, 0);
if (errno || args == tail || *tail != ' ')
{
{
opd->result.unsupported_algorithm = strdup (args);
if (!opd->result.unsupported_algorithm)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
}
}
}
long problem;
char *tail;
- errno = 0;
+ gpg_err_set_errno (0);
problem = strtol (args, &tail, 0);
if (errno || (*tail && *tail != ' '))
return gpg_error (GPG_ERR_INV_ENGINE);
gpgsm = calloc (1, sizeof *gpgsm);
if (!gpgsm)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
gpgsm->status_cb.fd = -1;
gpgsm->status_cb.dir = 1;
#if !USE_DESCRIPTOR_PASSING
if (_gpgme_io_pipe (fds, 0) < 0)
{
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
goto leave;
}
gpgsm->input_cb.fd = fds[1];
if (_gpgme_io_pipe (fds, 1) < 0)
{
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
goto leave;
}
gpgsm->output_cb.fd = fds[0];
if (_gpgme_io_pipe (fds, 0) < 0)
{
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
goto leave;
}
gpgsm->message_cb.fd = fds[1];
if (asprintf (&optstr, "OPTION display=%s", dft_display) < 0)
{
free (dft_display);
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
goto leave;
}
free (dft_display);
{
if (asprintf (&optstr, "OPTION ttyname=%s", dft_ttyname) < 0)
{
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
goto leave;
}
err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL, NULL,
if (asprintf (&optstr, "OPTION ttytype=%s", dft_ttytype) < 0)
{
free (dft_ttytype);
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
goto leave;
}
free (dft_ttytype);
return 0;
if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0)
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
else
{
err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL,
int fds[2];
if (_gpgme_io_pipe (fds, dir) < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
iocb_data->fd = dir ? fds[0] : fds[1];
iocb_data->server_fd = dir ? fds[1] : fds[0];
{
char *newline = realloc (*aline, *alinelen + linelen + 1);
if (!newline)
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
else
{
*aline = newline;
if (!nwritten || (nwritten < 0 && errno != EINTR)
|| nwritten > linelen)
{
- err = gpg_error_from_errno (errno);
+ err = gpg_error_from_syserror ();
break;
}
src += nwritten;
line = malloc (length);
if (!line)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
strcpy (line, "DELKEYS ");
linep = &line[8];
linelen = 10 + 40 + 1; /* "RECIPIENT " + guess + '\0'. */
line = malloc (10 + 40 + 1);
if (!line)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
strcpy (line, "RECIPIENT ");
for (i =0; !err && recp[i]; i++)
{
cmd = malloc (7 + strlen (pattern) + 1);
if (!cmd)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
strcpy (cmd, "EXPORT ");
strcpy (&cmd[7], pattern);
}
line = malloc (length);
if (!line)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
strcpy (line, "EXPORT ");
linep = &line[7];
/* Always send list-mode option because RESET does not reset it. */
if (asprintf (&line, "OPTION list-mode=%d", (list_mode & 3)) < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, line, NULL, NULL);
free (line);
if (err)
/* Length is "LISTSECRETKEYS " + p + '\0'. */
line = malloc (15 + strlen (pattern) + 1);
if (!line)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
if (secret_only)
{
strcpy (line, "LISTSECRETKEYS ");
/* Always send list-mode option because RESET does not reset it. */
if (asprintf (&line, "OPTION list-mode=%d", (list_mode & 3)) < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, line, NULL, NULL);
free (line);
if (err)
}
line = malloc (length);
if (!line)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
if (secret_only)
{
strcpy (line, "LISTSECRETKEYS ");
requested. */
if (asprintf (&assuan_cmd, "OPTION include-certs %i", include_certs) < 0)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, assuan_cmd,
NULL, NULL);
free (assuan_cmd);
void *pstate;
};
-#define ARGP_ERR_UNKNOWN E2BIG
+#define ARGP_ERR_UNKNOWN EDEADLOCK
#define ARGP_KEY_ARG 0
#define ARGP_KEY_ARGS 0x1000006
#define ARGP_KEY_END 0x1000001
gpg_error_t
gt_import_keys (gpgme_tool_t gt, char *fpr[])
{
- gpg_error_t err;
+ gpg_error_t err = 0;
int cnt;
int idx;
gpgme_key_t *keys;
import = malloc (sizeof (*import));
if (!import)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
import->next = NULL;
- errno = 0;
+ gpg_err_set_errno (0);
nr = strtol (args, &tail, 0);
if (errno || args == tail || *tail != ' ')
{
{
char *tail;
- errno = 0;
+ gpg_err_set_errno (0);
#define PARSE_NEXT(x) \
(x) = strtol (args, &tail, 0); \
if (!inv_key)
return gpg_error_from_errno (errno);
inv_key->next = NULL;
- errno = 0;
+ gpg_err_set_errno (0);
reason = strtol (args, &tail, 0);
if (errno || args == tail || (*tail && *tail != ' '))
{
{
char *filename = strdup (args);
if (!filename)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
*filenamep = filename;
}
# include <config.h>
#endif
+#include <gpg-error.h>
+#define __set_errno(ev) (gpg_err_set_errno (ev))
+
#if HAVE_ASSUAN_H
/* Fixme: Why do we need to include the assuan header and why the
internal ones? */
#define __builtin_expect(cond,val) (cond)
#include <errno.h>
-#if !_LIBC
-# if !defined errno && !defined HAVE_ERRNO_DECL
-extern int errno;
-# endif
-# define __set_errno(ev) ((errno) = (ev))
-#endif
#if _LIBC || HAVE_STDLIB_H
# include <stdlib.h>
sig = malloc (sizeof (*sig));
if (!sig)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
sig->next = NULL;
switch (*args)
return gpg_error (GPG_ERR_INV_ENGINE);
}
- errno = 0;
+ gpg_err_set_errno (0);
sig->pubkey_algo = strtol (args, &tail, 0);
if (errno || args == tail || *tail != ' ')
{
{
sig = calloc (1, sizeof (*sig));
if (!sig)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
if (!opd->result.signatures)
opd->result.signatures = sig;
if (opd->current_sig)
/* Parse the pubkey algo. */
if (!end)
goto parse_err_sig_fail;
- errno = 0;
+ gpg_err_set_errno (0);
sig->pubkey_algo = strtol (end, &tail, 0);
if (errno || end == tail || *tail != ' ')
goto parse_err_sig_fail;
/* Parse the hash algo. */
if (!*end)
goto parse_err_sig_fail;
- errno = 0;
+ gpg_err_set_errno (0);
sig->hash_algo = strtol (end, &tail, 0);
if (errno || end == tail || *tail != ' ')
goto parse_err_sig_fail;
{
sig->fpr = strdup (args);
if (!sig->fpr)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
}
return 0;
}
free (sig->fpr);
sig->fpr = strdup (args);
if (!sig->fpr)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
/* Skip the creation date. */
end = strchr (end, ' ');
if (end)
{
/* Parse the pubkey algo. */
- errno = 0;
+ gpg_err_set_errno (0);
sig->pubkey_algo = strtol (end, &tail, 0);
if (errno || end == tail || *tail != ' ')
return gpg_error (GPG_ERR_INV_ENGINE);
{
/* Parse the hash algo. */
- errno = 0;
+ gpg_err_set_errno (0);
sig->hash_algo = strtol (end, &tail, 0);
if (errno || end == tail || *tail != ' ')
return gpg_error (GPG_ERR_INV_ENGINE);
{
dest = notation->value = malloc (len);
if (!dest)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
}
else
{
int cur_len = strlen (notation->value);
dest = realloc (notation->value, len + strlen (notation->value));
if (!dest)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
notation->value = dest;
dest += cur_len;
}
TRACE1 (DEBUG_SYSIO, "gpgme:set_synchronize", hd,
"DuplicateHandle failed: ec=%d", (int) GetLastError ());
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return INVALID_HANDLE_VALUE;
}
ctx = find_reader (fd, 1);
if (!ctx)
{
- errno = EBADF;
+ gpg_err_set_errno (EBADF);
return TRACE_SYSRES (-1);
}
if (ctx->eof_shortcut)
TRACE_LOG ("EOF but ctx->eof flag not set");
return 0;
}
- errno = ctx->error_code;
+ gpg_err_set_errno (ctx->error_code);
return TRACE_SYSRES (-1);
}
TRACE_LOG1 ("ResetEvent failed: ec=%d", (int) GetLastError ());
UNLOCK (ctx->mutex);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
}
ctx->have_space_ev, (int) GetLastError ());
UNLOCK (ctx->mutex);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
UNLOCK (ctx->mutex);
TRACE_LOG1 ("ResetEvent failed: ec=%d", (int) GetLastError ());
UNLOCK (ctx->mutex);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
UNLOCK (ctx->mutex);
{
UNLOCK (ctx->mutex);
if (ctx->error_code == ERROR_NO_DATA)
- errno = EPIPE;
+ gpg_err_set_errno (EPIPE);
else
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
TRACE_LOG1 ("ResetEvent failed: ec=%d", (int) GetLastError ());
UNLOCK (ctx->mutex);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
if (!SetEvent (ctx->have_data))
TRACE_LOG1 ("SetEvent failed: ec=%d", (int) GetLastError ());
UNLOCK (ctx->mutex);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
UNLOCK (ctx->mutex);
{
TRACE_LOG1 ("CreatePipe failed: ec=%d", (int) GetLastError ());
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
CloseHandle (rh);
CloseHandle (wh);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
CloseHandle (rh);
CloseHandle (rh);
CloseHandle (wh);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
}
CloseHandle (rh);
CloseHandle (wh);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
CloseHandle (wh);
CloseHandle (rh);
CloseHandle (wh);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
}
if (fd == -1)
{
- errno = EBADF;
+ gpg_err_set_errno (EBADF);
return TRACE_SYSRES (-1);
}
{
TRACE_LOG1 ("CloseHandle failed: ec=%d", (int) GetLastError ());
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
if (i == DIM (notify_table))
{
UNLOCK (notify_table_lock);
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return TRACE_SYSRES (-1);
}
notify_table[i].fd = fd;
DeleteFile (tmp_name);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
DeleteFile (tmp_name);
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
/* Return the child name of this handle. */
TRACE_END (dbg_help, "oops ]");
TRACE_LOG ("Too many objects for WFMO!");
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
waitidx[nwait] = i;
TRACE_END (dbg_help, "oops ]");
TRACE_LOG ("Too many objects for WFMO!");
/* FIXME: Should translate the error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
waitidx[nwait] = i;
if (count < 0)
{
/* FIXME: Should determine a proper error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
}
return TRACE_SYSRES (count);
{
TRACE_LOG1 ("DuplicateHandle failed: ec=%d\n", (int) GetLastError ());
/* FIXME: Translate error code. */
- errno = EIO;
+ gpg_err_set_errno (EIO);
return TRACE_SYSRES (-1);
}
res = socket (domain, type, proto);
if (res == INVALID_SOCKET)
{
- errno = wsa2errno (WSAGetLastError ());
+ gpg_err_set_errno (wsa2errno (WSAGetLastError ()));
return TRACE_SYSRES (-1);
}
res = connect (fd, addr, addrlen);
if (res)
{
- errno = wsa2errno (WSAGetLastError ());
+ gpg_err_set_errno (wsa2errno (WSAGetLastError ()));
return TRACE_SYSRES (-1);
}
len = strlen (tmpl);
if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
{
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return -1;
}
fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
if (fd >= 0)
{
- errno = save_errno;
+ gpg_err_set_errno (save_errno);
return fd;
}
else if (errno != EEXIST)
}
/* We got out of the loop because we ran out of combinations to try. */
- errno = EEXIST;
+ gpg_err_set_errno (EEXIST);
return -1;
}