Branch: Tag:

2008-06-10

2008-06-10 12:16:17 by Martin Stjernholm <mast@lysator.liu.se>

Somewhat better error reporting in putenv (mainly to see what it
complains about on windows).

Rev: src/builtin.cmod:1.204

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin.cmod,v 1.203 2008/06/05 14:44:08 mast Exp $ + || $Id: builtin.cmod,v 1.204 2008/06/10 12:16:17 mast Exp $   */      #include "global.h"
20:   #include "pike_types.h"   #include "pike_memory.h"   #include "threads.h" - #include <math.h> - #include <ctype.h> +    #include "module_support.h"   #include "cyclic.h"   #include "bignum.h"
33:   #include "gc.h"   #include "block_alloc.h"   #include "pikecode.h" +    #include <assert.h> -  + #include <ctype.h> + #include <errno.h> + #include <math.h>      /*! @decl array(array(int|string|type)) describe_program(program p)    *! @belongs Debug
1346:    else    putenv_str = var;    -  if (putenv (putenv_str->str)) +  if (putenv (putenv_str->str)) { +  if (errno == ENOMEM)    SIMPLE_OUT_OF_MEMORY_ERROR ("putenv", 0); -  +  else +  Pike_error ("Error from putenv(3): %s\n", strerror (errno)); +  }      #ifdef __NT__    ref_push_string (var);