Yes, the checked in code will really not compile.
 
This is what I compiled:
 
static int cib_archive_filter(const struct dirent * a)
{
    /* Looking for regular files (S_IFREG = 10) starting with 'cib-' and not ending in .sig */
    struct stat s;
    stat(a->d_name, &s);
    if ((s.st_mode & S_IFREG) != S_IFREG) {
      return 0;
 
    } else if(strstr(a->d_name, "cib-") != a->d_name) {
        return 0;
 
    } else if(strstr(a->d_name, ".sig") != NULL) {
        return 0;
    }
    return 1;
}


________________________________

Von: Andrew Beekhof [mailto:notifications@github.com] 
Gesendet: Montag, 19. August 2013 09:43
An: beekhof/pacemaker
Cc: Grüninger, Andreas (LGL Extern)
Betreff: Re: [pacemaker] Upstream (#11)



In cib/io.c:

> @@ -288,8 +288,12 @@
>  static int cib_archive_filter(const struct dirent * a)
>  {
>      /* Looking for regular files (d_type = 8) starting with 'cib-' and not ending in .sig */
> -    if(a->d_type != 8) {
> -        return 0;
> +	struct stat s;
> +	stat(a->d_name, &s);
> +	if ((s.st_mode & S_IFREG) != S_IFREG)
> +	{
> +	  return 0;
> +	}

Err, surely this doesn't compile

-
Reply to this email directly or view it on GitHub <https://github.com/beekhof/pacemaker/pull/11/files#r5836150> . <https://github.com/notifications/beacon/kPg9oiG76wLdY5kVAGq2c7hRUR-QzOyVxX1OvhOXt7rgBhWlmwLTjnZP9anWu8QX.gif>