git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http-push: remove remote locks on exit signals

From
Clemens Buchacher <drizzd@aon.at>
Date
May 23, 2008, 22:17 UTC
Message-ID
<20080523221723.GA4366@localhost>
In-Reply-To
<7vod6wr95y.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, May 23, 2008 at 02:40:41PM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Clemens Buchacher <drizzd@aon.at> writes:
> > +static void remove_locks_on_signal(int signo)
> > +{
> > +	remove_locks();
> > +	signal(SIGINT, SIG_DFL);
> > +	raise(signo);
> > +}
> > +
> 
> If you caught signo, shouldn't you be resetting that signo not SIGINT?

True. I suppose we should fix that in remove_lock_file_on_signal() as well, then? It does exactly the same thing.

Show 11 quoted lines
> >  static void remote_ls(const char *path, int flags,
> >  		      void (*userFunc)(struct remote_ls_ctx *ls),
> >  		      void *userData);
> > @@ -2255,6 +2273,8 @@ int main(int argc, char **argv)
> >  		goto cleanup;
> >  	}
> >  
> > +	signal(SIGINT, remove_locks_on_signal);
> > +
> 
> and you may care more than just INT but perhaps HUP and others?

SIGINT was bothering me the most, because I often kill http-push by pressing Ctrl+C. I also considered adding SIGQUIT, but decided against it because normally I press Ctrl+\ only if I want the program to quit _right now_ and Ctrl+C does not work. On the other hand, sending the signal twice will terminate http-push either way.

I don't know in which situation SIGHUP would come into play.

Regards, Clemens

Previous: Junio C HamanoNext: Clemens Buchacher
Message 3 of 9 in “http-push: remove remote locks on exit signals”
  1. http-push: remove remote locks on exit signalsClemens Buchacher, May 22, 2008
  2. Junio C HamanoMay 23, 2008
  3. Clemens BuchacherMay 23, 2008
  4. Reset the signal being handledClemens Buchacher, May 25, 2008
  5. Johannes SchindelinMay 26, 2008
  6. lockfile: reset the correct signalClemens Buchacher, May 26, 2008
  7. Johannes SchindelinMay 26, 2008
  8. Clemens BuchacherMay 27, 2008
  9. http-push: remove remote locks on exit signalsClemens Buchacher, May 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.