7feeeb663163704c726a78729c20eb242274c109
9 const char *const envok
[]= {
15 "HTTP_ACCEPT_ENCODING",
16 "HTTP_ACCEPT_LANGUAGE",
41 const int nenvok
= sizeof(envok
)/sizeof(envok
[0]);
45 static void outerror(void) {
47 exit(debugmode ?
0 : -1);
50 void syserror(const char *m
) {
51 if (printf("Content-Type: text/plain\n\n"
52 "ucgi: system call error:\n"
54 m
,strerror(errno
))==EOF
|| fflush(stdout
)) outerror();
58 void error(const char *m
) {
59 if (printf("Content-Type: text/plain\n\n"
62 m
)==EOF
|| fflush(stdout
)) outerror();
66 void *xmalloc(size_t sz
) {
70 if (!r
) syserror("malloc failed");
74 void xsetenv(const char *en
, const char *ev
, int overwrite
) {
75 if (setenv(en
,ev
,overwrite
)) syserror("setenv");