git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: David Aguilar <davvid@gmail.com>
Cc: gitster@pobox.com, git@vger.kernel.org, peff@peff.net,
	markus.heidelberg@web.de, jnareb@gmail.com, j.sixt@viscovery.net
Subject: Re: [PATCH v7 1/3] compat: add a mkstemps() compatibility function
Date: Sun, 31 May 2009 19:03:55 -0700	[thread overview]
Message-ID: <7vr5y4ogl0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 1243758952-28972-1-git-send-email-davvid@gmail.com

David Aguilar <davvid@gmail.com> writes:

> mkstemps() is a BSD extension so provide an implementation
> for cross-platform use.
> ...
> diff --git a/git-compat-util.h b/git-compat-util.h
> index c7cf2d5..5a2d4e7 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -113,6 +113,10 @@
>  #define PATH_MAX 4096
>  #endif
>  
> +#ifndef TMP_MAX
> +#define TMP_MAX 16384
> +#endif

Giving fallback definition to PATH_MAX and PRIuMAX (as seen in the context
of the hunk) makes perfect sense.  TMP_MAX on the other hand is being
obsoleted in POSIX.1, and more importantly, we do not use it in our
program anywhere other than the compatibility implementation of
mkstemps().

I'll move this to the file that is used, which is compat/mkstemps.c.  I'll
further change the constant not to inherit from whatever the platform
happens to define TMP_MAX to be.  POSIX.1 says "at least 25", but the
fallback implementation does not need to be constrained to such a low
number.

Thanks.

      parent reply	other threads:[~2009-06-01  2:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-31  8:35 [PATCH v7 1/3] compat: add a mkstemps() compatibility function David Aguilar
2009-05-31  8:35 ` [PATCH v7 2/3] compat: add a basename() " David Aguilar
2009-05-31  8:35   ` [PATCH v7 3/3] diff: generate pretty filenames in prep_temp_blob() David Aguilar
2009-06-02  7:04     ` Johannes Sixt
2009-06-01  2:03 ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vr5y4ogl0.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=jnareb@gmail.com \
    --cc=markus.heidelberg@web.de \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).