diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-01-18 15:33:37 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-01-18 16:02:04 +0100 |
commit | 2a77682322b3d466ac16ce4bd1244d29085a3555 (patch) | |
tree | 6dba438ea995f5b4372af882cb6758a239f15b62 /libguile/simpos.c | |
parent | 33ed7a1644eda55a8dc479acf26418631cb937f9 (diff) | |
download | guile-2a77682322b3d466ac16ce4bd1244d29085a3555.tar.gz |
Use `scm_gc malloc_pointerless ()' in `scm_i allocate_string_pointers ()'.
* libguile/dynl.c (free_string_pointers): Remove.
(scm_dynamic_args_call): Remove reference to `free_string_pointers ()'
and remove dynwind.
* libguile/posix.c (free_string_pointers): Remove.
(scm_execl, scm_execlp, scm_execle, scm_environ): Remove references
to `free_string_pointers ()'.
* libguile/simpos.c (free_string_pointers): Remove.
(scm_system_star): Remove reference to `free_string_pointers ()',
remove enclosing dynwind.
* libguile/strings.c (scm_i_allocate_string_pointers): Use
`scm_gc_malloc_pointerless ()' and `scm_gc_malloc ()'
instead of `scm_malloc ()' and `scm_to_locale_string ()',
so that the result is automatically GC'd when no longer
referenced. Remove unneeded dynwind.
(scm_i_free_string_pointers): Remove.
* libguile/strings.h (scm_i_free_string_pointers): Remove declaration.
Diffstat (limited to 'libguile/simpos.c')
-rw-r--r-- | libguile/simpos.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/libguile/simpos.c b/libguile/simpos.c index 402e4dc88..e4c27b7e7 100644 --- a/libguile/simpos.c +++ b/libguile/simpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004 Free Software +/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2009 Free Software * Foundation, Inc. * * This library is free software; you can redistribute it and/or @@ -88,11 +88,6 @@ SCM_DEFINE (scm_system, "system", 0, 1, 0, #ifdef HAVE_SYSTEM #ifdef HAVE_WAITPID -static void -free_string_pointers (void *data) -{ - scm_i_free_string_pointers ((char **)data); -} SCM_DEFINE (scm_system_star, "system*", 0, 0, 1, (SCM args), @@ -127,12 +122,8 @@ SCM_DEFINE (scm_system_star, "system*", 0, 0, 1, int pid; char **execargv; - scm_dynwind_begin (0); - /* allocate before fork */ execargv = scm_i_allocate_string_pointers (args); - scm_dynwind_unwind_handler (free_string_pointers, execargv, - SCM_F_WIND_EXPLICITLY); /* make sure the child can't kill us (as per normal system call) */ sig_ign = scm_from_long ((unsigned long) SIG_IGN); @@ -148,7 +139,6 @@ SCM_DEFINE (scm_system_star, "system*", 0, 0, 1, execvp (execargv[0], execargv); SCM_SYSERROR; /* not reached. */ - scm_dynwind_end (); return SCM_BOOL_F; } else @@ -165,7 +155,6 @@ SCM_DEFINE (scm_system_star, "system*", 0, 0, 1, scm_sigaction (sigint, SCM_CAR (oldint), SCM_CDR (oldint)); scm_sigaction (sigquit, SCM_CAR (oldquit), SCM_CDR (oldquit)); - scm_dynwind_end (); return scm_from_int (status); } } |