git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jon Griffiths <jon_p_griffiths@yahoo.com>
Subject: Re: [PATCH 3/3] credential-cache--daemon: change to the socket dir on startup
Date: Tue, 23 Feb 2016 16:07:26 -0500	[thread overview]
Message-ID: <20160223210725.GA25854@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqfuwjyw59.fsf@gitster.mtv.corp.google.com>

On Tue, Feb 23, 2016 at 01:06:10PM -0800, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > +	/*
> > +	 * We don't actually care what our cwd is; we chdir here just to
> > +	 * be a friendly daemon and avoid tying up our original cwd.
> > +	 * If this fails, it's OK to just continue without that benefit.
> > +	 */
> > +	chdir(dir);
> 
> I fully do agree with this comment, but my copy of gcc and system
> headers doesn't, unfortunately.
> 
> credential-cache--daemon.c: In function 'init_socket_directory':
> credential-cache--daemon.c:245:7: error: ignoring return value of 'chdir', declared with attribute warn_unused_result [-Werror=unused-result]
>   chdir(dir);
>        ^
> cc1: all warnings being treated as errors
> make: *** [credential-cache--daemon.o] Error 1

Ugh. Is:

  (void)chdir(dir);

enough? Or do we have to do:

  if (chdir(dir))
	; /* nothing */

?

-Peff

  reply	other threads:[~2016-02-23 21:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  7:14 [PATCH 0/3] credential-cache: give daemon a predictable cwd Jeff King
2016-02-23  7:15 ` [PATCH 1/3] credential-cache--daemon: refactor check_socket_directory Jeff King
2016-02-23  7:15 ` [PATCH 2/3] credential-cache--daemon: disallow relative socket path Jeff King
2016-02-23  7:16 ` [PATCH 3/3] credential-cache--daemon: change to the socket dir on startup Jeff King
2016-02-23 21:06   ` Junio C Hamano
2016-02-23 21:07     ` Jeff King [this message]
2016-02-23 21:09       ` Junio C Hamano
2016-02-23 21:10         ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160223210725.GA25854@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jon_p_griffiths@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).