libc: introduce <envvars.h>

The new header envvars.h contains the names of commonly used
environment variables, such as $user, $ifs, $path and so on.

These defines are useful for Jehanne core applications that
use them to comunicate some values.

They are not strictly required, but having such defines we
can easily change the naming convention (from lowercase to uppercase).
This commit is contained in:
2017-10-20 00:55:05 +02:00
parent 65d37f432f
commit fab9c1d80f
47 changed files with 144 additions and 69 deletions

View File

@ -9,6 +9,7 @@
#include <u.h>
#include <libc.h>
#include <envvars.h>
#include <auth.h>
#include <9P2000.h>
#include "../boot/boot.h"
@ -22,7 +23,7 @@ authentication(int cpuflag)
char *argv[16], **av;
int ac;
if(jehanne_access(factotumPath, AEXEC) < 0 || jehanne_getenv("user") != nil){
if(jehanne_access(factotumPath, AEXEC) < 0 || jehanne_getenv(ENV_USER) != nil){
glenda();
return;
}
@ -69,7 +70,7 @@ glenda(void)
int fd;
char *s;
s = jehanne_getenv("user");
s = jehanne_getenv(ENV_USER);
if(s == nil)
s = "glenda";