chiark
/
gitweb
/
~ian
/
chiark-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d37635b
)
cgi-fcgi-interp: Add -D
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 22 Mar 2016 14:26:29 +0000
(14:26 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 22 Mar 2016 14:26:29 +0000
(14:26 +0000)
cprogs/cgi-fcgi-interp.c
patch
|
blob
|
history
diff --git
a/cprogs/cgi-fcgi-interp.c
b/cprogs/cgi-fcgi-interp.c
index 9ebad2bd83c5c376e350d27a2e461b4a44f0f707..0fdb88ee4e449ccc53548929ea5c282ee964705c 100644
(file)
--- a/
cprogs/cgi-fcgi-interp.c
+++ b/
cprogs/cgi-fcgi-interp.c
@@
-26,6
+26,10
@@
* speedy, the specified number of servers is started
* right away.) The default is 4.
*
* speedy, the specified number of servers is started
* right away.) The default is 4.
*
+ * -D
+ * Debug mode. Do not actually run program. Instead, print
+ * out what we would do.
+ *
* <options> and <interpreter> can be put into a single argument
* to cgi-fcgi-interp, separated by spaces or commas. <interpreter>
* must come last.
* <options> and <interpreter> can be put into a single argument
* to cgi-fcgi-interp, separated by spaces or commas. <interpreter>
* must come last.
@@
-97,7
+101,7
@@
#define MINHEXHASH 33
static const char *interp, *ident;
#define MINHEXHASH 33
static const char *interp, *ident;
-static int numservers;
+static int numservers
, debugmode
;
void diee(const char *m) {
err(127, "error: %s failed", m);
void diee(const char *m) {
err(127, "error: %s failed", m);
@@
-130,6
+134,7
@@
static const struct cmdinfo cmdinfos[]= {
{ "help", 0, .call= of_help },
{ 0, 'g', 1, .sassignto= &ident },
{ 0, 'M', 1, .call=of_iassign, .iassignto= &numservers },
{ "help", 0, .call= of_help },
{ 0, 'g', 1, .sassignto= &ident },
{ 0, 'M', 1, .call=of_iassign, .iassignto= &numservers },
+ { 0, 'D', 0, .iassignto= &debugmode, .arg= 1 },
{ 0 }
};
{ 0 }
};
@@
-306,9
+311,11
@@
int main(int argc, const char *const *argv) {
check_garbage();
check_garbage();
- printf("socket: %s\n",socket_path);
- printf("interp: %s\n",interp);
- printf("command: %s\n",command);
+ if (debugmode) {
+ printf("socket: %s\n",socket_path);
+ printf("interp: %s\n",interp);
+ printf("command: %s\n",command);
+ }
exit(0);
}
exit(0);
}