1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

Changes from arch/CVS synchronization

This commit is contained in:
Ludovic Courtès 2007-06-07 08:44:27 +00:00
parent 8edec42a34
commit 3b58a13b8b
8 changed files with 50 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2007-06-07 Ludovic Courtès <ludovic.courtes@laas.fr>
* posix.c (scm_ttyname): Check whether RESULT is NULL before
making a string from it (reported by Dan McMahill). Don't call
`scm_from_locale_string ()' before the mutex is released.
2007-03-08 Kevin Ryde <user42@zip.com.au>
* struct.c, struct.h (scm_make_vtable): New function, providing

View file

@ -834,7 +834,7 @@ SCM_DEFINE (scm_ttyname, "ttyname", 1, 0, 0,
{
char *result;
int fd, err;
SCM ret;
SCM ret = SCM_BOOL_F;
port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPPORT (1, port);
@ -843,9 +843,12 @@ SCM_DEFINE (scm_ttyname, "ttyname", 1, 0, 0,
fd = SCM_FPORT_FDES (port);
scm_i_scm_pthread_mutex_lock (&scm_i_misc_mutex);
SCM_SYSCALL (result = ttyname (fd));
err = errno;
ret = scm_from_locale_string (result);
if (result != NULL)
result = strdup (result);
scm_i_pthread_mutex_unlock (&scm_i_misc_mutex);
if (!result)
@ -853,6 +856,9 @@ SCM_DEFINE (scm_ttyname, "ttyname", 1, 0, 0,
errno = err;
SCM_SYSERROR;
}
else
ret = scm_take_locale_string (result);
return ret;
}
#undef FUNC_NAME