emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Better test than #ifdef BSD_SYSTEM in three places


From: Eric Gillespie
Subject: [PATCH] Better test than #ifdef BSD_SYSTEM in three places
Date: Sat, 30 Nov 2002 22:36:06 -0500
User-agent: nmh/1.0.4+dev (i386-unknown-netbsdelf1.6)

I noticed the getwd usage warning from gcc today and saw that
emacsclient.c is mistakenly using getwd on BSD systems.
configure looks for getcwd already, so i just changed it to test
HAVE_GETCWD.  I did a quick check over the rest of the tree and
corrected two other abuses of BSD_SYSTEM (fcntl.h in fileio.c and
sysdep.c).  Undoubtedly there are others, but these are the only
ones i'm sure of.

Index: lib-src/emacsclient.c
===================================================================
RCS file: /cvsroot/emacs/emacs/lib-src/emacsclient.c,v
retrieving revision 1.54
diff -a -u -r1.54 emacsclient.c
--- lib-src/emacsclient.c       1 Oct 2002 00:45:30 -0000       1.54
+++ lib-src/emacsclient.c       1 Dec 2002 03:28:19 -0000
@@ -418,19 +418,19 @@
       fail (argc, argv);
     }
 
-#ifdef BSD_SYSTEM
-  cwd = getwd (string);
-#else
+#ifdef HAVE_GETCWD
   cwd = getcwd (string, sizeof string);
+#else
+  cwd = getwd (string);
 #endif
   if (cwd == 0)
     {
       /* getwd puts message in STRING if it fails.  */
       fprintf (stderr, "%s: %s (%s)\n", argv[0],
-#ifdef BSD_SYSTEM
-              string,
-#else
+#ifdef HAVE_GETCWD
               "Cannot get current working directory",
+#else
+              string,
 #endif
               strerror (errno));
       fail (argc, argv);
Index: src/fileio.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/fileio.c,v
retrieving revision 1.465
diff -a -u -r1.465 fileio.c
--- src/fileio.c        27 Nov 2002 23:50:54 -0000      1.465
+++ src/fileio.c        1 Dec 2002 03:28:24 -0000
@@ -21,7 +21,7 @@
 
 #include <config.h>
 
-#if defined (USG5) || defined (BSD_SYSTEM) || defined (GNU_LINUX)
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
 
Index: src/sysdep.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/sysdep.c,v
retrieving revision 1.245
diff -a -u -r1.245 sysdep.c
--- src/sysdep.c        22 Nov 2002 12:22:43 -0000      1.245
+++ src/sysdep.c        1 Dec 2002 03:28:27 -0000
@@ -148,8 +148,7 @@
 #endif /* not VMS */
 
 #ifndef BSD4_1
-#ifdef BSD_SYSTEM /* avoid writing defined (BSD_SYSTEM) || defined (USG)
-             because the vms compiler doesn't grok `defined' */
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
 #ifdef USG




reply via email to

[Prev in Thread] Current Thread [Next in Thread]