Landry Breuil <[email protected]> writes:

> On Mon, Jan 12, 2015 at 05:04:32AM +0900, YASUOKA Masahiko wrote:
>> On Sun, 11 Jan 2015 20:30:42 +0100
>> Landry Breuil <[email protected]> wrote:
>> > On Mon, Jan 12, 2015 at 03:36:01AM +0900, YASUOKA Masahiko wrote:
>> >> I'd like to add 'iwatch' to our ports.
>> >> 
>> >> iwatch is "interval watch", it shows the command output periodically
>> >> and makes the changed words, lines or characters be highlighted so that
>> >> the changes can be monitored easily.  BSD/OS had a simillar command,
>> >> named watch(1), and linux also has watch(1).
>> >> 
>> >> iwatch was developed by IIJ (company I'm working for) and had been
>> >> used in IIJ for long time.  Currently it is maintained at
>> >> github.com/iij/iwatch by myself.
>> > 
>> > Since you're fetching code from github, you should use the various GH_*
>> > vars for consistency.. see lots of other ports for example, right now
>> > only geo/mapproxy comes to my mind :)
>> 
>> I didn't know GH_* since I refered wrong version's ports..  Thanks,
>> 
>> Update the tar.gz
>> 
>> ok?
>
> Dont hardcode usr/local, use $PREFIX or $TRUEPREFIX or $LOCALBASE
> depending on the situation... see bsd.port.mk. Other than that reads ok.

Same here.  There's a bug shown by strong malloc settings, though.
(ln -s S /etc/malloc.conf on amd64)

The following patch fixes it.  When initially allocating s and thus
cmdstr we need to make sure that it is a NUL-terminated string.

$OpenBSD$
--- iwatch.c.orig       Mon Jan 12 02:04:09 2015
+++ iwatch.c    Mon Jan 12 02:04:27 2015
@@ -161,7 +161,7 @@ main(int argc, char *argv[])
                while (strlen(cmdstr) + strlen(argv[i]) + 3 > cmdsiz) {
                        if (cmdsiz == 0) {
                                cmdsiz = 128;
-                               s = malloc(cmdsiz);
+                               s = calloc(cmdsiz, 1);
                        } else {
                                cmdsiz *= 2;
                                s = realloc(cmdstr, cmdsiz);


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to