zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: fix compilation when HAVE_GETRUSAGE is not defined
Date: Sun, 21 May 2023 02:43:40 +0200	[thread overview]
Message-ID: <70521-1684629820.173585@1Qyv.qhGV.Fv8y> (raw)

The alternate code path for when HAVE_GETRUSAGE is not defined
apparently got broken at some point. The following fixes it and also
silences a compiler warning when HAVE_SETUPTERM is likewise undefined.

Oliver

diff --git a/Src/jobs.c b/Src/jobs.c
index 4d7172550..dd7bba405 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1032,7 +1032,7 @@ should_report_time(Job j)
 	    return 1;
 #else
 	{
-	    clktck = get_clktck();
+	    long clktck = get_clktck();
 	    if ((j->procs->ti.ut + j->procs->ti.st) / clktck >= reporttime)
 		return 1;
 	}
diff --git a/Src/utils.c b/Src/utils.c
index 14ff0ed47..f13e3a79d 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -380,11 +380,13 @@ zerrmsg(FILE *file, const char *fmt, va_list ap)
     fflush(file);
 }
 
+#ifdef HAVE_SETUPTERM
 /*
  * Wrapper for setupterm() and del_curterm().
  * These are called from terminfo.c and termcap.c.
  */
 static int term_count;	/* reference count of cur_term */
+#endif
 
 /**/
 mod_export void


                 reply	other threads:[~2023-05-21  0:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=70521-1684629820.173585@1Qyv.qhGV.Fv8y \
    --to=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).