chiark / gitweb /
cgi-fcgi-interp: Rename "command" to "script" throughout
[chiark-utils.git] / cprogs / cgi-fcgi-interp.c
index d2681cfc861a068cd5cbe4d8e7003f7c466c23c0..f2ba0bdb1a98174c9c22e4788cf85b50a51c575c 100644 (file)
@@ -139,7 +139,7 @@ static const struct cmdinfo cmdinfos[]= {
 };
 
 static uid_t us;
-static const char *run_base, *command, *socket_path;
+static const char *run_base, *script, *socket_path;
 
 static bool find_run_base_var_run(void) {
   struct stat stab;
@@ -207,7 +207,7 @@ static void find_socket_path(void) {
   if (!ident) {
     if (maxidentlen < MINHEXHASH)
       errx(127,"base directory `%s'"
-          " leaves only %d characters for command name hash"
+          " leaves only %d characters for id hash"
           " which is too little (<%d)",
           run_base, maxidentlen, MINHEXHASH);
 
@@ -219,7 +219,7 @@ static void find_socket_path(void) {
 
     sha256_init(&sc);
     sha256_update(&sc,strlen(interp)+1,interp);
-    sha256_update(&sc,strlen(command)+1,command);
+    sha256_update(&sc,strlen(script)+1,script);
     sha256_digest(&sc,sizeof(bbuf),bbuf);
 
     for (i=0; i<identlen; i += 2)
@@ -254,8 +254,8 @@ static bool check_garbage(void) {
     err(127,"stat socket (%s)",socket_path);
   }
 
-  r = lstat(command, &cmd_stab);
-  if (r) err(127,"lstat command (%s)",command);
+  r = lstat(script, &cmd_stab);
+  if (r) err(127,"lstat script (%s)",script);
 
   return 0;
 }
@@ -304,8 +304,8 @@ int main(int argc, const char *const *argv) {
     shbang_opts(&argv, cmdinfos);
   }
 
-  command = *argv++;
-  if (!command) errx(127,"need command argument");
+  script = *argv++;
+  if (!script) errx(127,"need script argument");
   if (*argv) errx(127,"too many arguments");
 
   find_socket_path();
@@ -315,7 +315,7 @@ int main(int argc, const char *const *argv) {
   if (debugmode) {
     printf("socket: %s\n",socket_path);
     printf("interp: %s\n",interp);
-    printf("command: %s\n",command);
+    printf("script: %s\n",script);
   }
 
   exit(0);