From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 23:17:51 2012 Received: (at submit) by debbugs.gnu.org; 22 Nov 2012 04:17:51 +0000 Received: from localhost ([127.0.0.1]:60122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbOEY-00017o-Ic for submit@debbugs.gnu.org; Wed, 21 Nov 2012 23:17:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38611) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbOEV-00017g-R1 for submit@debbugs.gnu.org; Wed, 21 Nov 2012 23:17:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbODD-0001SO-Lw for submit@debbugs.gnu.org; Wed, 21 Nov 2012 23:16:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:39754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbODD-0001SK-Id for submit@debbugs.gnu.org; Wed, 21 Nov 2012 23:16:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbODB-0007m9-HG for bug-gnu-emacs@gnu.org; Wed, 21 Nov 2012 23:16:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbOD9-0001S8-9Z for bug-gnu-emacs@gnu.org; Wed, 21 Nov 2012 23:16:25 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:43133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbOD8-0001S2-SW for bug-gnu-emacs@gnu.org; Wed, 21 Nov 2012 23:16:23 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2F24039E8100 for ; Wed, 21 Nov 2012 20:16:22 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IvRZouKaR1Lf for ; Wed, 21 Nov 2012 20:16:20 -0800 (PST) Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9B4F1A60008 for ; Wed, 21 Nov 2012 20:16:20 -0800 (PST) Message-ID: <50ADA717.4060007@cs.ucla.edu> Date: Wed, 21 Nov 2012 20:16:23 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: Assume POSIX 1003.1-1988 or later for dirent.h. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Here's a patch that I'd like to install to simplify Emacs based on assuming that the underyling system supports POSIX 1003.1-1988 or later with respect to dirent.h. This is universal these days on GNUish hosts. I'm CC'ing this to Eli, as this affects the Microsoft port, by updating it a bit to use the POSIXish "struct dirent" rather than the pre-POSIX "struct direct". I have tested this on GNU/Linux but not on Microsoft. === modified file 'ChangeLog' --- ChangeLog 2012-11-21 21:06:52 +0000 +++ ChangeLog 2012-11-22 04:03:01 +0000 @@ -1,3 +1,8 @@ +2012-11-22 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h. + * configure.ac: Do not check for dirent.h or closdir. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-11-21 21:06:52 +0000 +++ admin/CPP-DEFINES 2012-11-22 04:03:01 +0000 @@ -118,7 +118,6 @@ HAVE_CFSETSPEED HAVE_CLOCK_GETTIME HAVE_CLOCK_SETTIME -HAVE_CLOSEDIR HAVE_COFF_H HAVE_COM_ERR_H HAVE_COPYSIGN @@ -143,7 +142,6 @@ HAVE_DEV_PTMX HAVE_DIALOGS HAVE_DIFFTIME -HAVE_DIRENT_H HAVE_DUP2 HAVE_ENDGRENT HAVE_ENDPWENT === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-11-21 21:06:52 +0000 +++ admin/ChangeLog 2012-11-22 04:03:01 +0000 @@ -1,3 +1,9 @@ +2012-11-22 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h. + * CPP-DEFINES (HAVE_CLOSEDIR, HAVE_DIRENT_H): Remove. + * notes/copyright: Adjust to src/ndir.h -> nt/inc/dirent.h renaming. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === modified file 'admin/notes/copyright' --- admin/notes/copyright 2012-01-19 07:21:25 +0000 +++ admin/notes/copyright 2012-11-22 04:03:01 +0000 @@ -380,7 +380,7 @@ src/gmalloc.c - contains numerous copyrights from the GNU C library. Leave them alone. -src/ndir.h +nt/inc/dirent.h - see comments below. This file is OK to be released with Emacs 22, but we may want to revisit it afterwards. @@ -429,7 +429,7 @@ File says it's in the public domain, but that might not make it so. etc/e/eterm-color.ti -src/ndir.h +nt/inc/dirent.h On legal advice from Matt Norwood, the following comment was added to these files in Feb/Mar 2007: === modified file 'configure.ac' --- configure.ac 2012-11-21 21:06:52 +0000 +++ configure.ac 2012-11-22 04:03:01 +0000 @@ -1289,7 +1289,7 @@ linux/version.h sys/systeminfo.h coff.h pty.h sys/vlimit.h sys/resource.h - sys/utsname.h pwd.h utmp.h dirent.h util.h) + sys/utsname.h pwd.h utmp.h util.h) AC_MSG_CHECKING(if personality LINUX32 can be set) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[personality (PER_LINUX32)]])], @@ -2891,7 +2891,7 @@ AC_CHECK_FUNCS(gethostname \ -closedir getrusage get_current_dir_name \ +getrusage get_current_dir_name \ lrand48 \ select getpagesize setlocale \ utimes getrlimit setrlimit shutdown getaddrinfo \ === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-11-21 21:06:52 +0000 +++ nt/ChangeLog 2012-11-22 04:03:01 +0000 @@ -1,3 +1,10 @@ +2012-11-22 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h. + * inc/dirent.h: Rename from ../src/ndir.h, with these changes: + (struct dirent): Rename from struct direct. All uses changed. + * inc/sys/dir.h: Remove. + 2012-11-21 Paul Eggert Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945). === renamed file 'src/ndir.h' => 'nt/inc/dirent.h' --- src/ndir.h 2011-01-15 23:16:57 +0000 +++ nt/inc/dirent.h 2012-11-22 04:03:01 +0000 @@ -1,7 +1,5 @@ /* - -- definitions for 4.2BSD-compatible directory access - - last edit: 09-Jul-1983 D A Gwyn + -- definitions for POSIX-compatible directory access * The code here is forced by the interface, and is not subject to * copyright, constituting the only possible expression of the @@ -16,7 +14,7 @@ #endif /* not WINDOWSNT */ /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */ -struct direct /* data from readdir() */ +struct dirent /* data from readdir() */ { long d_ino; /* inode number of entry */ unsigned short d_reclen; /* length of this record */ @@ -33,9 +31,8 @@ } DIR; /* stream data from opendir() */ extern DIR *opendir (char *); -extern struct direct *readdir (DIR *); +extern struct dirent *readdir (DIR *); extern void seekdir (DIR *, long); extern void closedir (DIR *); #define rewinddir( dirp ) seekdir( dirp, 0L ) - === removed file 'nt/inc/sys/dir.h' --- nt/inc/sys/dir.h 2011-01-15 23:16:57 +0000 +++ nt/inc/sys/dir.h 1970-01-01 00:00:00 +0000 @@ -1,6 +0,0 @@ -/* - * map sys\dir.h to ..\..\..\src\ndir.h - */ - -#include "..\..\..\src\ndir.h" - === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-22 03:56:38 +0000 +++ src/ChangeLog 2012-11-22 04:06:38 +0000 @@ -1,3 +1,20 @@ +2012-11-22 Paul Eggert + + Assume POSIX 1003.1-1988 or later for dirent.h. + * dired.c: Assume HAVE_DIRENT_H. + (NAMLEN): Remove, replacing with ... + (dirent_namelen): New function. All uses changed. Use the GNU macro + _D_EXACT_NAMELEN if available, as it's faster than strlen. + (DIRENTRY): Remove, replacing all uses with 'struct dirent'. + (DIRENTRY_NONEMPTY): Remove, replacing with ... + (dirent_nonempty): New function. All uses changed. + * makefile.w32-in (DIR_H): Now just dirent.h, not sys/dir.h and ndir.h. + ($(BLD)/w32.$(O)): Depend on $(DIR_H), not $(SRC)/ndir.h. + * ndir.h: Rename to ../nt/inc/dirent.h. + * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove. + Do not include ; no longer needed. + * w32.c: Include rather than "ndir.h". + 2012-11-22 Eli Zaretskii * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts === modified file 'src/dired.c' --- src/dired.c 2012-10-01 02:07:14 +0000 +++ src/dired.c 2012-11-22 04:03:01 +0000 @@ -31,44 +31,10 @@ #include #include -/* The d_nameln member of a struct dirent includes the '\0' character - on some systems, but not on others. What's worse, you can't tell - at compile-time which one it will be, since it really depends on - the sort of system providing the filesystem you're reading from, - not the system you are running on. Paul Eggert - says this occurs when Emacs is running on a - SunOS 4.1.2 host, reading a directory that is remote-mounted from a - Solaris 2.1 host and is in a native Solaris 2.1 filesystem. - - Since applying strlen to the name always works, we'll just do that. */ -#define NAMLEN(p) strlen (p->d_name) - -#ifdef HAVE_DIRENT_H - #include -#define DIRENTRY struct dirent - -#else /* not HAVE_DIRENT_H */ - -#include -#include - -#define DIRENTRY struct direct - -extern DIR *opendir (char *); -extern struct direct *readdir (DIR *); - -#endif /* HAVE_DIRENT_H */ - #include #include -#ifdef MSDOS -#define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != 0) -#else -#define DIRENTRY_NONEMPTY(p) ((p)->d_ino) -#endif - #include "lisp.h" #include "systime.h" #include "character.h" @@ -88,6 +54,28 @@ static ptrdiff_t scmp (const char *, const char *, ptrdiff_t); +/* Return the number of bytes in DP's name. */ +static ptrdiff_t +dirent_namelen (struct dirent *dp) +{ +#ifdef _D_EXACT_NAMLEN + return _D_EXACT_NAMLEN (dp); +#else + return strlen (dp->d_name); +#endif +} + +/* Return true if DP represents a real directory entry. */ +static bool +dirent_nonempty (struct dirent *dp) +{ +#ifdef MSDOS + return dp->d_name[0] != 0; +#else + return 1; +#endif +} + #ifdef WINDOWSNT Lisp_Object directory_files_internal_w32_unwind (Lisp_Object arg) @@ -124,7 +112,7 @@ bool needsep = 0; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; - DIRENTRY *dp; + struct dirent *dp; #ifdef WINDOWSNT Lisp_Object w32_save = Qnil; #endif @@ -225,14 +213,14 @@ if (dp == NULL) break; - if (DIRENTRY_NONEMPTY (dp)) + if (dirent_nonempty (dp)) { ptrdiff_t len; bool wanted = 0; Lisp_Object name, finalname; struct gcpro gcpro1, gcpro2; - len = NAMLEN (dp); + len = dirent_namelen (dp); name = finalname = make_unibyte_string (dp->d_name, len); GCPRO2 (finalname, name); @@ -442,7 +430,8 @@ return file_name_completion (file, directory, 1, Qnil); } -static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); +static int file_name_completion_stat (Lisp_Object dirname, struct dirent *dp, + struct stat *st_addr); static Lisp_Object Qdefault_directory; static Lisp_Object @@ -499,7 +488,7 @@ /* (att3b compiler bug requires do a null comparison this way) */ while (1) { - DIRENTRY *dp; + struct dirent *dp; ptrdiff_t len; bool canexclude = 0; @@ -517,10 +506,10 @@ if (!dp) break; - len = NAMLEN (dp); + len = dirent_namelen (dp); QUIT; - if (! DIRENTRY_NONEMPTY (dp) + if (! dirent_nonempty (dp) || len < SCHARS (encoded_file) || 0 <= scmp (dp->d_name, SSDATA (encoded_file), SCHARS (encoded_file))) @@ -806,9 +795,10 @@ } static int -file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr) +file_name_completion_stat (Lisp_Object dirname, struct dirent *dp, + struct stat *st_addr) { - ptrdiff_t len = NAMLEN (dp); + ptrdiff_t len = dirent_namelen (dp); ptrdiff_t pos = SCHARS (dirname); int value; USE_SAFE_ALLOCA; === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-11-17 23:16:24 +0000 +++ src/makefile.w32-in 2012-11-22 04:03:01 +0000 @@ -413,8 +413,7 @@ $(MS_W32_H) CONFIG_H = $(SRC)/config.h \ $(CONF_POST_H) -DIR_H = $(NT_INC)/sys/dir.h \ - $(SRC)/ndir.h +DIR_H = $(NT_INC)/dirent.h W32GUI_H = $(SRC)/w32gui.h \ $(SYSTIME_H) DISPEXTERN_H = $(SRC)/dispextern.h \ @@ -1175,7 +1174,6 @@ $(BLD)/w32.$(O) : \ $(SRC)/w32.c \ - $(SRC)/ndir.h \ $(SRC)/w32.h \ $(SRC)/w32common.h \ $(SRC)/w32heap.h \ @@ -1187,6 +1185,7 @@ $(CAREADLINKAT_H) \ $(CODING_H) \ $(CONFIG_H) \ + $(DIR_H) \ $(DISPEXTERN_H) \ $(GRP_H) \ $(LISP_H) \ === modified file 'src/sysdep.c' --- src/sysdep.c 2012-11-21 21:06:52 +0000 +++ src/sysdep.c 2012-11-22 04:03:01 +0000 @@ -2220,28 +2220,6 @@ &emacs_norealloc_allocator, careadlinkatcwd); } -/* Directory routines for systems that don't have them. */ - -#ifdef HAVE_DIRENT_H - -#include - -#if !defined (HAVE_CLOSEDIR) - -int -closedir (DIR *dirp /* stream from opendir */) -{ - int rtnval; - - rtnval = emacs_close (dirp->dd_fd); - xfree (dirp); - - return rtnval; -} -#endif /* not HAVE_CLOSEDIR */ -#endif /* HAVE_DIRENT_H */ - - /* Return a struct timeval that is roughly equivalent to T. Use the least timeval not less than T. Return an extremal value if the result would overflow. */ === modified file 'src/w32.c' --- src/w32.c 2012-11-22 03:56:38 +0000 +++ src/w32.c 2012-11-22 04:06:38 +0000 @@ -179,7 +179,7 @@ #undef sendto #include "w32.h" -#include "ndir.h" +#include #include "w32common.h" #include "w32heap.h" #include "w32select.h" @@ -2448,7 +2448,7 @@ and readdir. We can't use the procedures supplied in sysdep.c, so we provide them here. */ -struct direct dir_static; /* simulated directory contents */ +struct dirent dir_static; /* simulated directory contents */ static HANDLE dir_find_handle = INVALID_HANDLE_VALUE; static int dir_is_fat; static char dir_pathname[MAXPATHLEN+1]; @@ -2518,7 +2518,7 @@ xfree ((char *) dirp); } -struct direct * +struct dirent * readdir (DIR *dirp) { int downcase = !NILP (Vw32_downcase_file_names); @@ -2572,7 +2572,7 @@ downcase = 1; /* 8+3 aliases are returned in all caps */ } dir_static.d_namlen = strlen (dir_static.d_name); - dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 + + dir_static.d_reclen = sizeof (struct dirent) - MAXNAMLEN + 3 + dir_static.d_namlen - dir_static.d_namlen % 4; /* If the file name in cFileName[] includes `?' characters, it means From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 21 23:38:04 2012 Received: (at 12958) by debbugs.gnu.org; 22 Nov 2012 04:38:04 +0000 Received: from localhost ([127.0.0.1]:60129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbOY8-0001ZN-4M for submit@debbugs.gnu.org; Wed, 21 Nov 2012 23:38:04 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:59324) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbOY5-0001Yy-Il for 12958@debbugs.gnu.org; Wed, 21 Nov 2012 23:38:02 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 8200839E8118; Wed, 21 Nov 2012 20:36:42 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oDseqfxxngcM; Wed, 21 Nov 2012 20:36:41 -0800 (PST) Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B908939E8008; Wed, 21 Nov 2012 20:36:41 -0800 (PST) Message-ID: <50ADABDD.9080802@cs.ucla.edu> Date: Wed, 21 Nov 2012 20:36:45 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: Assume POSIX 1003.1-1988 or later for dirent.h. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 12958 Cc: 12958@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.8 (-) Whoops, forgot to CC: it to Eli. Eli, here's the URL for this proposed cleanup patch to Emacs: http://bugs.gnu.org/12958 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 00:14:38 2012 Received: (at control) by debbugs.gnu.org; 22 Nov 2012 05:14:38 +0000 Received: from localhost ([127.0.0.1]:60135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbP7W-0002M4-AY for submit@debbugs.gnu.org; Thu, 22 Nov 2012 00:14:38 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:60320) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbP7U-0002Lx-1k for control@debbugs.gnu.org; Thu, 22 Nov 2012 00:14:37 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2DF1039E8100 for ; Wed, 21 Nov 2012 21:13:17 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id waZeAmVmDfg3 for ; Wed, 21 Nov 2012 21:13:16 -0800 (PST) Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id E247139E8008 for ; Wed, 21 Nov 2012 21:13:16 -0800 (PST) Message-ID: <50ADB470.9050201@cs.ucla.edu> Date: Wed, 21 Nov 2012 21:13:20 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: 12958 has a patch Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.8 (-) tags 12958 patch From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 11:28:07 2012 Received: (at 12958) by debbugs.gnu.org; 22 Nov 2012 16:28:07 +0000 Received: from localhost ([127.0.0.1]:33352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbZdG-0005T5-QX for submit@debbugs.gnu.org; Thu, 22 Nov 2012 11:28:07 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]:48837) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbZdD-0005Sm-MH for 12958@debbugs.gnu.org; Thu, 22 Nov 2012 11:28:05 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MDW00500DMSOS00@a-mtaout21.012.net.il> for 12958@debbugs.gnu.org; Thu, 22 Nov 2012 18:26:40 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDW0059ADOFND30@a-mtaout21.012.net.il>; Thu, 22 Nov 2012 18:26:39 +0200 (IST) Date: Thu, 22 Nov 2012 18:26:25 +0200 From: Eli Zaretskii Subject: Re: Assume POSIX 1003.1-1988 or later for dirent.h. In-reply-to: <50ADABDD.9080802@cs.ucla.edu> X-012-Sender: halo1@inter.net.il To: Paul Eggert Message-id: <833901vc26.fsf@gnu.org> References: <50ADABDD.9080802@cs.ucla.edu> X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Date: Wed, 21 Nov 2012 20:36:45 -0800 > From: Paul Eggert > CC: 12958@debbugs.gnu.org > > Whoops, forgot to CC: it to Eli. No sweat, I'm subscribed to bug-gnu-emacs. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.179.55.169 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4813] X-Debbugs-Envelope-To: 12958 Cc: 12958@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.7 (/) > Date: Wed, 21 Nov 2012 20:36:45 -0800 > From: Paul Eggert > CC: 12958@debbugs.gnu.org > > Whoops, forgot to CC: it to Eli. No sweat, I'm subscribed to bug-gnu-emacs. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 12:22:04 2012 Received: (at 12958) by debbugs.gnu.org; 22 Nov 2012 17:22:04 +0000 Received: from localhost ([127.0.0.1]:33409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbaTU-0006hr-4O for submit@debbugs.gnu.org; Thu, 22 Nov 2012 12:22:04 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:38779) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbaTR-0006hP-QQ for 12958@debbugs.gnu.org; Thu, 22 Nov 2012 12:22:02 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MDW00E00G2SBE00@a-mtaout22.012.net.il> for 12958@debbugs.gnu.org; Thu, 22 Nov 2012 19:20:03 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDW00DVVG5FN3F0@a-mtaout22.012.net.il>; Thu, 22 Nov 2012 19:20:03 +0200 (IST) Date: Thu, 22 Nov 2012 19:19:49 +0200 From: Eli Zaretskii Subject: Re: bug#12958: Assume POSIX 1003.1-1988 or later for dirent.h. In-reply-to: <50ADA717.4060007@cs.ucla.edu> X-012-Sender: halo1@inter.net.il To: Paul Eggert Message-id: <83y5httv0q.fsf@gnu.org> References: <50ADA717.4060007@cs.ucla.edu> X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Date: Wed, 21 Nov 2012 20:16:23 -0800 > From: Paul Eggert > > Here's a patch that I'd like to install to simplify Emacs based > on assuming that the underyling system supports POSIX 1003.1-1988 > or later with respect to dirent.h. This is universal these days > on GNUish hosts. I'm CC'ing this to Eli, as this affects the > Microsoft port, by updating it a bit to use the POSIXish > "struct dirent" rather than the pre-POSIX "struct direct". > I have tested this on GNU/Linux but not on Microsoft. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.179.55.172 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4998] X-Debbugs-Envelope-To: 12958 Cc: 12958@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.7 (/) > Date: Wed, 21 Nov 2012 20:16:23 -0800 > From: Paul Eggert > > Here's a patch that I'd like to install to simplify Emacs based > on assuming that the underyling system supports POSIX 1003.1-1988 > or later with respect to dirent.h. This is universal these days > on GNUish hosts. I'm CC'ing this to Eli, as this affects the > Microsoft port, by updating it a bit to use the POSIXish > "struct dirent" rather than the pre-POSIX "struct direct". > I have tested this on GNU/Linux but not on Microsoft. This is OK, but this part: > +/* Return true if DP represents a real directory entry. */ > +static bool > +dirent_nonempty (struct dirent *dp) > +{ > +#ifdef MSDOS > + return dp->d_name[0] != 0; > +#else > + return 1; > +#endif > +} is not needed at all. The reason there was an MSDOS specific definition of DIRENT_NONEMPTY macro is that the Posix definition used d_ino, which the MSDOS implementation doesn't provide. But if that member is not used, we can toss this macro and assume that every entry is "real". Otherwise, I see no problems with this patch. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 22 12:50:02 2012 Received: (at 12958) by debbugs.gnu.org; 22 Nov 2012 17:50:02 +0000 Received: from localhost ([127.0.0.1]:33436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbauY-0007O7-8p for submit@debbugs.gnu.org; Thu, 22 Nov 2012 12:50:02 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:60828) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbauW-0007Nq-Re for 12958@debbugs.gnu.org; Thu, 22 Nov 2012 12:50:01 -0500 Received: by mail-ee0-f44.google.com with SMTP id b47so5229141eek.3 for <12958@debbugs.gnu.org>; Thu, 22 Nov 2012 09:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=KY9UtAnk7XQi3hkS1hqX7e7yg7ku7H6mw91m2RWYayE=; b=E8FwfDNJ0cNhmgnmu/dBsz7LjomHqZfleDo+Usbk5PpPP+t7YbdjPY5rrX8e4nTdFL fAgw0RALV/5Gd/BAIu+X31WNgAz5Rc8PI0JuLqk1PsSiOCZBkXBWEiqYb5dpmr7DTTmw JTM/IcSHSuHeuX4cPOsh4+mQ6KJN3yzhzIKO9bGilodou/vkwJLbwC7sb2kpJyAfODCt IOzxUtP0UvHd92+CC0QLae1TwcDL2X0D60Sw5hvGt0Q+C41c5p95qpklafU67paGO3uo TXx2mQbUP4Ct2dDmvL5vFH6/QTnL46chw4d5091fEhCewdG+QF2ydKX1QweDeFVP9MxW ZqEw== Received: by 10.14.1.69 with SMTP id 45mr3599186eec.23.1353606518660; Thu, 22 Nov 2012 09:48:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.4.209 with HTTP; Thu, 22 Nov 2012 09:47:58 -0800 (PST) In-Reply-To: <50ADA717.4060007@cs.ucla.edu> References: <50ADA717.4060007@cs.ucla.edu> From: Juanma Barranquero Date: Thu, 22 Nov 2012 18:47:58 +0100 Message-ID: Subject: Re: bug#12958: Assume POSIX 1003.1-1988 or later for dirent.h. To: Paul Eggert Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12958 Cc: 12958@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) On Thu, Nov 22, 2012 at 5:16 AM, Paul Eggert wrote: > -DIR_H = $(NT_INC)/sys/dir.h \ > - $(SRC)/ndir.h > +DIR_H = $(NT_INC)/dirent.h Just remove DIR_H, and modify dired.$(O) entry to include $(NT_INC)/dirent.h instead just after $(SRC)/regex.h. Thanks, Juanma From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 23 04:11:11 2012 Received: (at 12958-done) by debbugs.gnu.org; 23 Nov 2012 09:11:11 +0000 Received: from localhost ([127.0.0.1]:34086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpHy-0007HY-Qy for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:11:11 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:50105) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpHx-0007HR-3i for 12958-done@debbugs.gnu.org; Fri, 23 Nov 2012 04:11:09 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id BCDCAA6001E; Fri, 23 Nov 2012 01:09:43 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WGJ7gGEieSLn; Fri, 23 Nov 2012 01:09:43 -0800 (PST) Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7BD38A60008; Fri, 23 Nov 2012 01:09:43 -0800 (PST) Message-ID: <50AF3D58.6000109@cs.ucla.edu> Date: Fri, 23 Nov 2012 01:09:44 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12958: Assume POSIX 1003.1-1988 or later for dirent.h. References: <50ADA717.4060007@cs.ucla.edu> <83y5httv0q.fsf@gnu.org> In-Reply-To: <83y5httv0q.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12958-done Cc: 12958-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Thanks, Eli and Juanma. I made both sets of changes and installed it as trunk bzr 110986. From unknown Sat Jun 21 10:42:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 21 Dec 2012 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator