Branch: Tag:

2010-04-27

2010-04-27 14:58:11 by Henrik Grubbström (Grubba) <grubba@grubba.org>

status_change() needs one more argument to avoid excessive recursion.

Rev: lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1.37
Rev: lib/modules/Filesystem.pmod/Monitor.pmod/symlinks.pike:1.9

1:   //   // Basic filesystem monitor.   // - // $Id: basic.pike,v 1.36 2010/02/03 15:24:41 grubba Exp $ + // $Id: basic.pike,v 1.37 2010/04/27 14:58:11 grubba Exp $   //   // 2009-07-09 Henrik Grubbström   //
357:       //! Called when the status has changed for an existing file.    protected int(0..1) status_change(Stdio.Stat old_st, Stdio.Stat st, -  int orig_flags) +  int orig_flags, int flags)    {    if (st->isdir) {    array(string) files = get_dir(path) || ({});
568:    if ((st->mtime != old_st->mtime) || (st->ctime != old_st->ctime) ||    (st->size != old_st->size)) {    last_change = time(1); -  if (status_change(old_st, st, orig_flags)) return 1; +  if (status_change(old_st, st, orig_flags, flags)) return 1;    }    if ((flags & MF_RECURSE) && (st->isdir)) {    // Check the files in the directory.