On 12/05/16 21:20, David Turner wrote: > From: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> [snip] > > +/* in ms */ > +#define WATCHMAN_TIMEOUT 1000 > + > +static int poke_and_wait_for_reply(int fd) > +{ > + struct strbuf buf = STRBUF_INIT; > + int ret = -1; > + struct pollfd pollfd; > + int bytes_read; > + char reply_buf[4096]; > + const char *requested_capabilities = ""; > + > +#ifdef USE_WATCHMAN > + requested_capabilities = "watchman"; > +#endif > + > + if (fd < 0) > + return -1; > + > + strbuf_addf(&buf, "poke %d %s", getpid(), requested_capabilities); > + if (packet_write_gently(fd, buf.buf, buf.len)) This is not causing a problem or bug, but is none the less not correct - as you know, packet_write_gently() takes a 'printf' like variable argument list. (So, buf.buf is the format specifier and buf.len is an unused arg). I think I would write this as: strbuf_addf(&buf, "poke %d", getpid()); if (requested_capabilities && *requested_capabilities) strbuf_addf(&buf, " %s", requested_capabilities); if (packet_write_gently(fd, "%s", buf.buf)) ... or something similar. [Note, just typing into my email client, so it's not been close to a compiler.] > + return -1; > + if (packet_flush_gently(fd)) > + return -1; Why are you sending a flush packet - doesn't the index-helper simply ignore it? I haven't tried this yet BTW, just reading patches as they float on past... ;-) ATB, Ramsay Jones -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html