From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 12945@debbugs.gnu.org
Subject: bug#12945: Assume POSIX 1003.1-1988 or later for unistd.h.
Date: Wed, 21 Nov 2012 05:40:30 +0200 [thread overview]
Message-ID: <83wqxfvd1t.fsf@gnu.org> (raw)
In-Reply-To: <50ABED34.7040307@cs.ucla.edu>
> Date: Tue, 20 Nov 2012 12:51:00 -0800
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: 12945@debbugs.gnu.org
>
> > Here's the patch for that:
>
> Thanks. Won't we need patches elswhere to match?
Some, but not all. See below.
> Also, how is this related to the "#define getcwd _getcwd" in
> lib-src/ntlib.h?
We might need that for MSVC. But that's a different issue, since
lib-src programs don't use any code in w32.c.
> --- nt/config.nt 2012-11-17 23:58:56 +0000
> +++ nt/config.nt 2012-11-20 20:44:17 +0000
> @@ -411,11 +411,10 @@
> /* Define to 1 if you have the `getaddrinfo' function. */
> #undef HAVE_GETADDRINFO
>
> -/* Define to 1 if you have the `getcwd' function.
> - If you think about defining HAVE_GETCWD, don't: the alternative
> - getwd is redefined on w32.c, and does not really return the current
> +/* Define to 1 if you have the `getcwd' function. This is
> + defined on w32.c, and does not really return the current
> directory, to get the desired results elsewhere in Emacs. */
> -#undef HAVE_GETCWD
> +#define HAVE_GETCWD 1
This should be removed entirely, since there are no HAVE_GETCWD tests
anymore, right?
> === modified file 'src/msdos.c'
> --- src/msdos.c 2012-11-05 03:18:32 +0000
> +++ src/msdos.c 2012-11-20 20:44:17 +0000
> @@ -3784,7 +3784,7 @@
> Lisp_Object cmd;
>
> /* Get current directory as MSDOS cwd is not per-process. */
> - getwd (oldwd);
> + getcwd (oldwd, sizeof oldwd);
MSDOS is unrelated. This can be changed or left alone.
> --- src/sysdep.c 2012-11-20 17:33:00 +0000
> +++ src/sysdep.c 2012-11-20 20:44:17 +0000
> @@ -101,7 +101,6 @@
> #define _P_WAIT 0
> int _cdecl _spawnlp (int, const char *, const char *, ...);
> int _cdecl _getpid (void);
> -extern char *getwd (char *);
> #endif
>
> #include "syssignal.h"
> @@ -504,7 +503,7 @@
> const char *sh = 0;
>
> #ifdef DOS_NT /* MW, Aug 1993 */
> - getwd (oldwd);
> + getcwd (oldwd, sizeof oldwd);
> if (sh == 0)
> sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
> #endif
This is needed.
> === modified file 'src/w32.h'
> --- src/w32.h 2012-10-17 19:02:44 +0000
> +++ src/w32.h 2012-11-20 20:44:17 +0000
> @@ -163,7 +163,7 @@
> extern void register_child (int, int);
>
> extern void sys_sleep (int);
> -extern char *getwd (char *);
> +extern char *getcwd (char *, size_t);
> extern int sys_link (const char *, const char *);
This isn't needed; the prototype for getcwd is on a system header.
The prototype for getwd should be removed.
next prev parent reply other threads:[~2012-11-21 3:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 17:38 bug#12945: Assume POSIX 1003.1-1988 or later for unistd.h Paul Eggert
2012-11-20 18:14 ` Eli Zaretskii
2012-11-20 20:13 ` Eli Zaretskii
2012-11-20 20:51 ` Paul Eggert
2012-11-21 3:40 ` Eli Zaretskii [this message]
2012-11-21 21:07 ` Paul Eggert
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=83wqxfvd1t.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=12945@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.