bash prompt: test the prompt with newline in repository path
[gitweb.git] / daemon.c
index 80df5cb54ef63620faa88096ca6b7a02a8c43bf8..34916c5e105812e36d659dfeeb8341e003e746bd 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -600,7 +600,7 @@ static void parse_host_arg(char *extra_args, int buflen)
 
 static int execute(void)
 {
-       static char line[1000];
+       char *line = packet_buffer;
        int pktlen, len, i;
        char *addr = getenv("REMOTE_ADDR"), *port = getenv("REMOTE_PORT");
 
@@ -608,7 +608,7 @@ static int execute(void)
                loginfo("Connection from %s:%s", addr, port);
 
        alarm(init_timeout ? init_timeout : timeout);
-       pktlen = packet_read_line(0, line, sizeof(line));
+       pktlen = packet_read(0, NULL, NULL, packet_buffer, sizeof(packet_buffer), 0);
        alarm(0);
 
        len = strlen(line);
@@ -1047,18 +1047,6 @@ static int service_loop(struct socketlist *socklist)
        }
 }
 
-/* if any standard file descriptor is missing open it to /dev/null */
-static void sanitize_stdfds(void)
-{
-       int fd = open("/dev/null", O_RDWR, 0);
-       while (fd != -1 && fd < 2)
-               fd = dup(fd);
-       if (fd == -1)
-               die_errno("open /dev/null or dup failed");
-       if (fd > 2)
-               close(fd);
-}
-
 #ifdef NO_POSIX_GOODIES
 
 struct credentials;