]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/job.c: [SV 63185] Include sys/loadavg.h if needed.
authorPaul Smith <psmith@gnu.org>
Sat, 15 Oct 2022 22:38:18 +0000 (18:38 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 16 Oct 2022 20:19:42 +0000 (16:19 -0400)
src/job.c

index 19f2797761c25b8f532c503acaa3103d7698fd42..a47824a7507c7b566c4dd104cd3bea4929699dfe 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -204,6 +204,15 @@ int getgid ();
 # endif
 #endif
 
+#if HAVE_SYS_LOADAVG_H
+# include <sys/time.h>
+# include <sys/loadavg.h>
+#endif
+
+#ifndef HAVE_DECL_GETLOADAVG
+int getloadavg (double loadavg[], int nelem);
+#endif
+
 /* Different systems have different requirements for pid_t.
    Plus we have to support gettext string translation... Argh.  */
 static const char *
@@ -220,10 +229,6 @@ pid2str (pid_t pid)
   return pidstring;
 }
 
-#ifndef HAVE_DECL_GETLOADAVG
-int getloadavg (double loadavg[], int nelem);
-#endif
-
 static void free_child (struct child *);
 static void start_job_command (struct child *child);
 static int load_too_high (void);