mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 01:00:20 +02:00
* posix.c (scm_uname): throw an error if uname fails instead
of returning errno. * error.h (scm_errno, scm_perror): obsolete prototypes removed. * error.c (err_head, scm_errno, scm_perror): obsolete procedures removed. * async.c (scm_ints_disabled): definition moved from error.c.
This commit is contained in:
parent
1d80497659
commit
a574455a13
5 changed files with 19 additions and 67 deletions
|
@ -1,3 +1,15 @@
|
|||
Sat Mar 15 01:11:40 1997 Gary Houston <ghouston@actrix.gen.nz>
|
||||
|
||||
* posix.c (scm_uname): throw an error if uname fails instead
|
||||
of returning errno.
|
||||
|
||||
* error.h (scm_errno, scm_perror): obsolete prototypes removed.
|
||||
|
||||
* error.c (err_head, scm_errno, scm_perror): obsolete procedures
|
||||
removed.
|
||||
|
||||
* async.c (scm_ints_disabled): definition moved from error.c.
|
||||
|
||||
Sat Mar 15 00:06:08 1997 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
|
||||
|
||||
* acconfig.h: Removed PACKAGE.
|
||||
|
|
|
@ -84,7 +84,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
/* True between SCM_DEFER_INTS and SCM_ALLOW_INTS, and
|
||||
* when the interpreter is not running at all.
|
||||
*/
|
||||
int scm_ints_disabled = 1;
|
||||
|
||||
unsigned int scm_async_clock = 20;
|
||||
static unsigned int scm_async_rate = 20;
|
||||
|
|
|
@ -58,70 +58,8 @@
|
|||
*/
|
||||
|
||||
|
||||
/* True between SCM_DEFER_INTS and SCM_ALLOW_INTS, and
|
||||
* when the interpreter is not running at all.
|
||||
*/
|
||||
int scm_ints_disabled = 1;
|
||||
|
||||
extern int errno;
|
||||
|
||||
static void err_head SCM_P ((char *str));
|
||||
|
||||
static void
|
||||
err_head (str)
|
||||
char *str;
|
||||
{
|
||||
int oerrno = errno;
|
||||
if (SCM_NIMP (scm_cur_outp))
|
||||
scm_fflush (scm_cur_outp);
|
||||
scm_gen_putc ('\n', scm_cur_errp);
|
||||
#if 0
|
||||
if (SCM_BOOL_F != *scm_loc_loadpath)
|
||||
{
|
||||
scm_prin1 (*scm_loc_loadpath, scm_cur_errp, 1);
|
||||
scm_gen_puts (scm_regular_string, ", line ", scm_cur_errp);
|
||||
scm_intprint ((long) scm_linum, 10, scm_cur_errp);
|
||||
scm_gen_puts (scm_regular_string, ": ", scm_cur_errp);
|
||||
}
|
||||
#endif
|
||||
scm_fflush (scm_cur_errp);
|
||||
errno = oerrno;
|
||||
if (scm_cur_errp == scm_def_errp)
|
||||
{
|
||||
if (errno > 0)
|
||||
perror (str);
|
||||
fflush (stderr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SCM_PROC(s_errno, "errno", 0, 1, 0, scm_errno);
|
||||
SCM
|
||||
scm_errno (arg)
|
||||
SCM arg;
|
||||
{
|
||||
int old = errno;
|
||||
if (!SCM_UNBNDP (arg))
|
||||
{
|
||||
if (SCM_FALSEP (arg))
|
||||
errno = 0;
|
||||
else
|
||||
errno = SCM_INUM (arg);
|
||||
}
|
||||
return SCM_MAKINUM (old);
|
||||
}
|
||||
|
||||
SCM_PROC(s_perror, "perror", 1, 0, 0, scm_perror);
|
||||
SCM
|
||||
scm_perror (arg)
|
||||
SCM arg;
|
||||
{
|
||||
SCM_ASSERT (SCM_NIMP (arg) && SCM_STRINGP (arg), arg, SCM_ARG1, s_perror);
|
||||
err_head (SCM_CHARS (arg));
|
||||
return SCM_UNSPECIFIED;
|
||||
}
|
||||
|
||||
void (*scm_error_callback) () = 0;
|
||||
|
||||
/* All errors should pass through here. */
|
||||
|
|
|
@ -59,9 +59,6 @@ extern int scm_ints_disabled;
|
|||
#define SCM_NORETURN
|
||||
#endif
|
||||
|
||||
|
||||
extern SCM scm_errno SCM_P ((SCM arg));
|
||||
extern SCM scm_perror SCM_P ((SCM arg));
|
||||
extern void scm_error SCM_P ((SCM key, char *subr, char *message,
|
||||
SCM args, SCM rest)) SCM_NORETURN;
|
||||
extern void (*scm_error_callback) SCM_P ((SCM key, char *subr,
|
||||
|
|
|
@ -773,8 +773,9 @@ scm_uname ()
|
|||
struct utsname buf;
|
||||
SCM ans = scm_make_vector(SCM_MAKINUM(5), SCM_UNSPECIFIED, SCM_BOOL_F);
|
||||
SCM *ve = SCM_VELTS (ans);
|
||||
SCM_DEFER_INTS;
|
||||
if (uname (&buf))
|
||||
return SCM_MAKINUM (errno);
|
||||
scm_syserror (s_uname);
|
||||
ve[0] = scm_makfrom0str (buf.sysname);
|
||||
ve[1] = scm_makfrom0str (buf.nodename);
|
||||
ve[2] = scm_makfrom0str (buf.release);
|
||||
|
@ -784,6 +785,7 @@ scm_uname ()
|
|||
a linux special?
|
||||
ve[5] = scm_makfrom0str (buf.domainname);
|
||||
*/
|
||||
SCM_ALLOW_INTS;
|
||||
return ans;
|
||||
#else
|
||||
scm_sysmissing (s_uname);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue