From: Ben Gras Date: Tue, 3 May 2005 15:38:41 +0000 (+0000) Subject: Device variables get copies of their contents in *_n variables for scripts X-Git-Tag: v3.1.0~881 X-Git-Url: http://zhaoyanbai.com/repos/tz-link.htm?a=commitdiff_plain;h=27b7e7c72e43e2cf3c5f651027120e11cc49b321;p=minix.git Device variables get copies of their contents in *_n variables for scripts that want the device name (as opposed to the number for the kernel). --- diff --git a/boot/boot.c b/boot/boot.c index c948f2926..3fbef84f5 100755 --- a/boot/boot.c +++ b/boot/boot.c @@ -741,13 +741,28 @@ int b_setenv(int flags, char *name, char *arg, char *value) } e->arg= copystr(arg); e->value= copystr(value); + + if(e->flags & E_DEV) { + char newname[30]; + strncpy(newname, name, sizeof(newname)-3); + newname[sizeof(newname)-4] = '\0'; + strcat(newname, "_n"); + b_setenv(E_VAR, newname, arg, value); + } + return 0; } int b_setvar(int flags, char *name, char *value) /* Set variable or simple function. */ { - return b_setenv(flags, name, null, value); + int r; + + if((r=b_setenv(flags, name, null, value))) { + return r; + } + + return r; } void b_unset(char *name)