diff options
author | Junio C Hamano <junkio@cox.net> | 2007-04-21 17:38:00 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-21 17:38:00 -0700 |
commit | a2d7c6c62080b542007f9787342aa1e57b95f50c (patch) | |
tree | 22348e2f38132cd45dcf74cf0c02475d95dbce5b /lockfile.c | |
parent | afb5b6a24bd333d298d10acac731f1c127bbb82d (diff) | |
parent | 5e635e396020cc08bc21a3e67c20c5294d6d13fd (diff) | |
download | git-a2d7c6c62080b542007f9787342aa1e57b95f50c.tar.gz |
Merge branch 'jc/attr'
* 'jc/attr': (28 commits)
lockfile: record the primary process.
convert.c: restructure the attribute checking part.
Fix bogus linked-list management for user defined merge drivers.
Simplify calling of CR/LF conversion routines
Document gitattributes(5)
Update 'crlf' attribute semantics.
Documentation: support manual section (5) - file formats.
Simplify code to find recursive merge driver.
Counto-fix in merge-recursive
Fix funny types used in attribute value representation
Allow low-level driver to specify different behaviour during internal merge.
Custom low-level merge driver: change the configuration scheme.
Allow the default low-level merge driver to be configured.
Custom low-level merge driver support.
Add a demonstration/test of customized merge.
Allow specifying specialized merge-backend per path.
merge-recursive: separate out xdl_merge() interface.
Allow more than true/false to attributes.
Document git-check-attr
Change attribute negation marker from '!' to '-'.
...
Diffstat (limited to 'lockfile.c')
-rw-r--r-- | lockfile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lockfile.c b/lockfile.c index bed6b21daf..23db35aff2 100644 --- a/lockfile.c +++ b/lockfile.c @@ -8,8 +8,11 @@ static const char *alternate_index_output; static void remove_lock_file(void) { + pid_t me = getpid(); + while (lock_file_list) { - if (lock_file_list->filename[0]) + if (lock_file_list->owner == me && + lock_file_list->filename[0]) unlink(lock_file_list->filename); lock_file_list = lock_file_list->next; } @@ -28,6 +31,7 @@ static int lock_file(struct lock_file *lk, const char *path) sprintf(lk->filename, "%s.lock", path); fd = open(lk->filename, O_RDWR | O_CREAT | O_EXCL, 0666); if (0 <= fd) { + lk->owner = getpid(); if (!lk->on_list) { lk->next = lock_file_list; lock_file_list = lk; |