From mboxrd@z Thu Jan 1 00:00:00 1970 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes Resent-Date: Sun, 31 Jan 1999 21:46:14 -0500 (EST) To: zsh-workers@math.gatech.edu Subject: PATCH: zsh-3.1.5-pws-6: cygwin rlimit config fix From: Matt Armstrong MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: 31 Jan 1999 18:44:24 -0800 Message-ID: User-Agent: Gnus/5.07007 (Pterodactyl Gnus v0.70) Emacs/20.3 Resent-Message-ID: <"UEjF53.0.Qd6.sLHjs"@math> Resent-From: zsh-workers@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Resent-Sender: zsh-workers-request@math.gatech.edu X-Mailing-List: 5132 This is a MIME multipart message. If you are reading this, you shouldn't. --=-=-= Zsh's makepro.awk script currently pulls all the prototypes out of the source file regardless of whether they're compiled into the image. This causes a problem with with exec.pro, since it pulls out prototypes for current_limits, which is in terms of the RLIM_NLIMITS #define. If HAVE_GETRLIMIT isn't defined, RLIM_NLIMITS probably isn't either. The upshot is that exec.pro doesn't compile when running under cygwin. It also causes a few warnings to have prototypes for static functions that are never defined. The fix I used was to have makepro.awk handle things like /**/ #ifdef HAVE_GETRLIMIT and spit them out in the .pro file along with the prototypes like so: #ifdef HAVE_GETRLIMIT extern struct rlimit current_limits[RLIM_NLIMITS]; extern struct rlimit limits[RLIM_NLIMITS]; extern int zsetlimit _((int limnum,char*nam)); extern int setlimits _((char*nam)); #endif /* HAVE_GETRLIMIT */ ...which nicely avoids the problem. --=-=-= Content-Type: application/x-patch Content-Disposition: attachment; filename=cygnus-rlimit.patch Content-Transfer-Encoding: 8bit Content-Description: Fix for rlimit config problem Index: zsh/ChangeLog diff -c zsh/ChangeLog:1.1.1.1 zsh/ChangeLog:1.4 *** zsh/ChangeLog:1.1.1.1 Sat Jan 23 18:10:11 1999 --- zsh/ChangeLog Sat Jan 30 14:06:22 1999 *************** *** 1,3 **** --- 1,34 ---- + 1999-01-24 Matt Armstrong + + * Src/init.c: Stick /**/ before autoload_zleread() #ifdefs to + avoid compiler warning. + + * Src/exec.c: Stick /**/ before and after #ifdef GET_RLIMIT to + prevent a reference to RLIM_NLIMITS in exec.pro. + + * Src/makepro.awk: Handles preprocessor conditionals after /**/ + lines. Index: zsh/Src/exec.c diff -c zsh/Src/exec.c:1.1.1.2 zsh/Src/exec.c:1.2 *** zsh/Src/exec.c:1.1.1.2 Sat Jan 23 20:48:36 1999 --- zsh/Src/exec.c Sun Jan 24 10:41:28 1999 *************** *** 148,153 **** --- 148,154 ---- return l; } + /**/ #ifdef HAVE_GETRLIMIT /* the resource limits for the shell and its children */ *************** *** 184,189 **** --- 185,191 ---- return ret; } + /**/ #endif /* HAVE_GETRLIMIT */ /* fork and set limits */ Index: zsh/Src/init.c diff -c zsh/Src/init.c:1.1.1.3 zsh/Src/init.c:1.3 *** zsh/Src/init.c:1.1.1.3 Sat Jan 30 10:15:06 1999 --- zsh/Src/init.c Sat Jan 30 10:30:07 1999 *************** *** 936,941 **** --- 936,942 ---- /* do nothing */ } + /**/ # ifdef UNLINKED_XMOD_zle /**/ *************** *** 947,952 **** --- 948,954 ---- return zleread(lp, rp, ha); } + /**/ # endif /* UNLINKED_XMOD_zle */ /**/ Index: zsh/Src/makepro.awk diff -c zsh/Src/makepro.awk:1.1.1.2 zsh/Src/makepro.awk:1.3 *** zsh/Src/makepro.awk:1.1.1.2 Sat Jan 23 20:48:39 1999 --- zsh/Src/makepro.awk Sun Jan 24 10:48:29 1999 *************** *** 40,45 **** --- 40,52 ---- aborting = 1 exit 1 } + if (line == "" && $0 ~ /^[ \t]*#/) { + # Directly after the /**/ was a preprocessor line. + # Spit it out and re-start the outer loop. + printf "%s\n", $0 + locals = locals $0 "\n" + next + } gsub(/\t/, " ") line = line " " $0 gsub(/\/\*([^*]|\*+[^*\/])*\*+\//, " ", line) --=-=-=--