#define OS_UNSETENV
int
-os_unsetenv(const char *name)
+os_unsetenv(const uschar * name)
{
- unsetenv(name);
- return 0;
+unsetenv(CS name);
+return 0;
}
/* It's considered broken if we do not find the '=', according to
Florian Weimer. For now we ignore such strings. unsetenv() would complain,
getenv() would complain. */
- uschar *eqp = Ustrchr(*p, '=');
+ uschar * eqp = Ustrchr(*p, '=');
if (eqp)
{
- uschar *name = string_copyn(*p, eqp - *p);
+ uschar * name = string_copyn(*p, eqp - *p);
+
if (OK != match_isinlist(name, CUSS &keep_environment,
0, NULL, NULL, MCL_NOEXPAND, FALSE, NULL))
if (os_unsetenv(name) < 0) return FALSE;
}
if (add_environment)
{
- uschar *p;
+ uschar * p;
int sep = 0;
- const uschar* envlist = add_environment;
- while ((p = string_nextinlist(&envlist, &sep, NULL, 0)))
- putenv(CS p);
+ const uschar * envlist = add_environment;
+
+ while ((p = string_nextinlist(&envlist, &sep, NULL, 0))) putenv(CS p);
}
return TRUE;
#if !defined(OS_UNSETENV)
int
-os_unsetenv(const char *name)
+os_unsetenv(const uschar * name)
{
- return unsetenv(name);
+return unsetenv(CS name);
}
#endif
this, for all other systems we provide our own getcwd() */
#if !defined(OS_GETCWD)
-char *
-os_getcwd(char *buffer, size_t size)
+uschar *
+os_getcwd(uschar * buffer, size_t size)
{
-return getcwd(buffer, size);
+return getcwd(CS buffer, size);
}
#else
#ifndef PATH_MAX
# define PATH_MAX 4096
#endif
-char *
-os_getcwd(char *buffer, size_t size)
+uschar *
+os_getcwd(uschar * buffer, size_t size)
{
void *rc;
if (!size) size = PATH_MAX;
-if (!buffer && !(buffer = (char*) malloc(size))) return NULL;
-if (!(buffer = getcwd(buffer, size))) return NULL;
-return realloc(buffer, strlen(buffer) + 1);
+if (!buffer && !(buffer = US malloc(size))) return NULL;
+if (!(buffer = getcwd(CS buffer, size))) return NULL;
+return realloc(CS buffer, strlen(buffer) + 1);
}
#endif
extern const char *os_strsignal(int); /* char to match strsignal in some OS */
#endif
#ifndef os_unsetenv
-extern int os_unsetenv(const char *);
+extern int os_unsetenv(const uschar *);
#endif
#ifndef os_getcwd
-extern char* os_getcwd(char *, size_t);
+extern uschar *os_getcwd(uschar *, size_t);
#endif
/* End of osfunctions.h */
if (tz)
(void) setenv("TZ", CCS tz, 1);
else
- (void) os_unsetenv("TZ");
+ (void) os_unsetenv(US"TZ");
tzset();
}
}
else
{
- const uschar * s;
+ const char * s;
if (hosts_retry == hosts_total)
- s = US"retry time not reached for any host%s";
+ s = "retry time not reached for any host%s";
else if (hosts_fail == hosts_total)
- s = US"all host address lookups%s failed permanently";
+ s = "all host address lookups%s failed permanently";
else if (hosts_defer == hosts_total)
- s = US"all host address lookups%s failed temporarily";
+ s = "all host address lookups%s failed temporarily";
else if (hosts_serial == hosts_total)
- s = US"connection limit reached for all hosts%s";
+ s = "connection limit reached for all hosts%s";
else if (hosts_fail+hosts_defer == hosts_total)
- s = US"all host address lookups%s failed";
+ s = "all host address lookups%s failed";
else
- s = US"some host address lookups failed and retry time "
+ s = "some host address lookups failed and retry time "
"not reached for other hosts or connection limit reached%s";
addr->message = string_sprintf(s,