Re: fatal: unable to create '.git/index': File exists

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Fredrik Kuivinen
Date: Saturday, January 6, 2007 - 2:24 am

On 1/5/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

We will get SIGINT when the user hits ^C so I don't think the atexit handler
will run. However, we also install a signal handler for SIGINT which removes
the lock file, so I don't really see how it can be left around...

There is a small race condition between open and signal as we do

    fd = open(lk->filename, O_RDWR | O_CREAT | O_EXCL, 0666);
    ...
    signal(SIGINT, remove_lock_file_on_signal);
    atexit(remove_lock_file);

in lock_file:lockfile.c. But I think it is very improbable that the user hits ^C
between  "open" and "signal". It might be worth fixing though.

Are there any other signals we might get when the user hits ^C? SIGPIPE?

- Fredrik
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
fatal: unable to create '.git/index': File exists, Len Brown, (Fri Jan 5, 9:50 am)
Re: fatal: unable to create '.git/index': File exists, Johannes Schindelin, (Fri Jan 5, 1:16 pm)
Re: fatal: unable to create '.git/index': File exists, Fredrik Kuivinen, (Sat Jan 6, 2:24 am)