From: Tarmigan Date: Tue, 15 Dec 2009 22:13:53 GMT Subject: Re: Git on QNX Message-ID: <905315640912151413g10ee5befh58fbd171237e7659@mail.gmail.com> In-Reply-To: <7v6387zzfi.fsf@alter.siamese.dyndns.org> On Tue, Dec 15, 2009 at 1:42 PM, Junio C Hamano wrote: > Tarmigan writes: > >> diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c >> index 8ed4a6f..5cbc16c 100644 >> --- a/builtin-fetch-pack.c >> +++ b/builtin-fetch-pack.c >> @@ -778,7 +778,7 @@ static int fetch_pack_config(const char *var, >> const char *value, void *cb) >>       return git_default_config(var, value, cb); >>  } >> >> -static struct lock_file lock; >> +static struct lock_file lockfile; >> >>  static void fetch_pack_setup(void) >>  { >> @@ -958,14 +958,14 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, >>                         ) >>                       die("shallow file was changed during fetch"); >> >> -             fd = hold_lock_file_for_update(&lock, shallow, >> +             fd = hold_lock_file_for_update(&lockfile, shallow, >>                                              LOCK_DIE_ON_ERROR); >>               if (!write_shallow_commits(&sb, 0) >>                || write_in_full(fd, sb.buf, sb.len) != sb.len) { >>                       unlink_or_warn(shallow); >> -                     rollback_lock_file(&lock); >> +                     rollback_lock_file(&lockfile); >>               } else { >> -                     commit_lock_file(&lock); >> +                     commit_lock_file(&lockfile); >>               } >>               strbuf_release(&sb); >>       } > > Is this because QNX uses "lock" as some global identifier for some other > purpose?  I think moving the file-scope-static definition to the scope > it is used in without renaming would make a cleaner patch. Yes, exactly that reason. I agree the declaration should just move into fetch_pack() as a static, but I didn't realize that until after I had renamed all of the uses, and I was lazy as this was not for submission. > >> diff --git a/git-compat-util.h b/git-compat-util.h >> index 5c59687..857e938 100644 >> --- a/git-compat-util.h >> +++ b/git-compat-util.h >> @@ -79,6 +84,7 @@ >>  #include >>  #include >>  #include >> +#include >>  #include >>  #include >>  #include > > Other hunks are QNX specific enough but this hunk is worrisome; you cannot > tell how you are hurting other platforms with this change.  Can you tell > declarations of which functions are missing on QNX without this change? strcasecmp() http://www.opengroup.org/onlinepubs/000095399/functions/strcasecmp.html I agree that this change could affect other platforms and they've gotten along fine without it so far. I'm surprised no others have needed it. Would it be better wrapped in a #ifdef? Thanks, Tarmigan