> +/* Helper function to ensure that we are opening a file and not a directory */ > +static FILE *open_file(char *full_path) > +{ > + struct stat st_buf; > + if (stat(full_path, &st_buf) || !S_ISREG(st_buf.st_mode)) > + return NULL; > + return (fopen(full_path, "r")); > +} That looks wrong. stat+fopen has a pointless race condition that open+fstat+fdopen would not have. Morten - 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