From: Ben Gras Date: Mon, 3 Apr 2006 18:26:43 +0000 (+0000) Subject: We have setenv() now. X-Git-Tag: v3.1.2a~79 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=f0ebf5e4c32f76cbafc4f3ef5cc525670f7bf9a0;p=minix.git We have setenv() now. --- diff --git a/commands/cron/cron.c b/commands/cron/cron.c index a4f6fa145..71e43dac1 100755 --- a/commands/cron/cron.c +++ b/commands/cron/cron.c @@ -32,21 +32,6 @@ static volatile int need_reload;/* Set if table reload required. */ static volatile int need_quit; /* Set if cron must exit. */ static volatile int debug; /* Debug level. */ -static int setenv(char *var, char *val) -/* Set an environment variable. Return 0/-1 for success/failure. */ -{ - char *env; - - env= malloc((strlen(var) + strlen(val) + 2) * sizeof(env[0])); - if (env == nil) return -1; - strcpy(env, var); - strcat(env, "="); - strcat(env, val); - if (putenv(env) < 0) return -1; - free(env); - return 0; -} - static void run_job(cronjob_t *job) /* Execute a cron job. Register its pid in the job structure. If a job's * crontab has an owner then its output is mailed to that owner, otherwise