[cl-debian] Bug#410374: ecl: depends on MAXPATHLEN or PATH_MAX being defined
Package: ecl Version: 0.9i-2 Severity: important Tags: patch Justification: fails to build from source ECL throws an error during compilation if neither MAXPATHLEN nor PATH_MAX are defined, though POSIX explicitely permits those constants to be undefined. Applications should test for their definition and if needed use sysconf() to get the actual value. As neither constant is defined on Hurd, ECL wouldn't build at all. Here is a preliminary (and rather unintrusive) patch that doesn't check at runtime for the limit but enable building ECL: diff -r 045b9347e44a src/c/pathname.d --- a/src/c/pathname.d Tue Feb 06 17:36:54 2007 +0100 +++ b/src/c/pathname.d Sat Feb 10 06:27:50 2007 +0100 @@ -29,8 +29,8 @@ #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX -# else -# error "Either MAXPATHLEN or PATH_MAX should be defined" +//# else +//# error "Either MAXPATHLEN or PATH_MAX should be defined" # endif #endif @@ -754,8 +754,10 @@ si_coerce_to_filename(cl_object pathname FEerror("Pathname ~A does not have a physical namestring", 1, pathname_orig); } +#ifdef MAXPATHLEN if (namestring->base_string.fillp >= MAXPATHLEN - 16) FEerror("Too long filename: ~S.", 1, namestring); +#endif return namestring; } diff -r 045b9347e44a src/c/unixfsys.d --- a/src/c/unixfsys.d Tue Feb 06 17:36:54 2007 +0100 +++ b/src/c/unixfsys.d Sat Feb 10 06:38:53 2007 +0100 @@ -49,8 +49,8 @@ #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX -# else -# error "Either MAXPATHLEN or PATH_MAX should be defined" +//# else +//# error "Either MAXPATHLEN or PATH_MAX should be defined" # endif #endif @@ -247,7 +247,15 @@ FILE * FILE * backup_fopen(const char *filename, const char *option) { +#ifdef MAXPATHLEN char backupfilename[MAXPATHLEN]; +#else + char *backupfilename = malloc(strlen(filename) + 5); + if (backupfilename == NULL) { + // not sure how allocation failure should be dealt with + FElibc_error("Cannot allocate memory for backup filename", 0); + } +#endif strcat(strcpy(backupfilename, filename), ".BAK"); #ifdef _MSC_VER @@ -258,6 +266,9 @@ backup_fopen(const char *filename, const if (rename(filename, backupfilename)) FElibc_error("Cannot rename the file ~S to ~S.", 2, make_constant_base_string(filename), make_simple_base_string(backupfilename)); +#ifndef MAXPATHLEN + free(backupfilename); +#endif return fopen(filename, option); } -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (990, 'testing'), (501, 'stable'), (500, 'unstable'), (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.17-2-k7 Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Versions of packages ecl depends on: ii common-lisp-controller 6.9 This is a Common Lisp source and c ii gcc-4.1 4.1.1-21 The GNU C compiler ii libc6 2.3.6.ds1-10 GNU C Library: Shared libraries ii libgc-dev 1:6.8-1 conservative garbage collector for ii libgc1c2 1:6.8-1 conservative garbage collector for ii libgmp3-dev 2:4.2.1+dfsg-4 Multiprecision arithmetic library ii libgmp3c2 2:4.2.1+dfsg-4 Multiprecision arithmetic library ii libncurses5-dev 5.5-5 Developer's libraries and docs for ecl recommends no packages. -- no debconf information -- nowhere.man@levallois.eu.org OpenPGP 0xD9D50D8A
Your message dated Thu, 29 Mar 2007 10:02:27 +0000 with message-id <E1HWrSd-0007mx-2O@ries.debian.org> and subject line Bug#410374: fixed in ecl 0.9i-20070324-1 has caused the attached Bug report to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what I am talking about this indicates a serious mail system misconfiguration somewhere. Please contact me immediately.) Debian bug tracking system administrator (administrator, Debian Bugs database)
participants (2)
-
owner@bugs.debian.org -
Pierre THIERRY