summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d80694)
raw | patch | inline | side by side (parent: 7d80694)
author | Linus Torvalds <torvalds@g5.osdl.org> | |
Fri, 15 Jul 2005 16:32:16 +0000 (09:32 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Fri, 15 Jul 2005 16:32:16 +0000 (09:32 -0700) |
All credit go to Alexey Nezhdanov <snake@penza-gsm.ru>, I just ended up
re-implementing his idea.
re-implementing his idea.
daemon.c | patch | blob | history |
diff --git a/daemon.c b/daemon.c
index c5a46b73f00cd467c7d867bbad6d2308a27c2fc6..74a1934dc2f1746a0985331eab26bb2ce53d3af3 100644 (file)
--- a/daemon.c
+++ b/daemon.c
#include <sys/socket.h>
#include <netinet/in.h>
-static const char daemon_usage[] = "git-daemon [--port=n]";
+static const char daemon_usage[] = "git-daemon [--inetd | --port=n]";
static int upload(char *dir, int dirlen)
{
int main(int argc, char **argv)
{
int port = DEFAULT_GIT_PORT;
+ int inetd_mode = 0;
int i;
for (i = 1; i < argc; i++) {
continue;
}
}
+
+ if (!strcmp(arg, "--inetd")) {
+ inetd_mode = 1;
+ continue;
+ }
+
usage(daemon_usage);
}
+ if (inetd_mode)
+ return execute();
+
return serve(port);
}