summaryrefslogtreecommitdiff
path: root/packaging/make-3.81-err-reporting.patch
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-05 11:16:31 -0800
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>2015-01-02 11:45:55 +0100
commitcc0e474118bad882d690b23698fede80c06f6ef1 (patch)
tree25186e39b86ea3542f3ccdfc7cb110866d02db73 /packaging/make-3.81-err-reporting.patch
parente15597c3e85dedc015ff923a88febd46a1551f71 (diff)
downloadmake-cc0e474118bad882d690b23698fede80c06f6ef1.tar.gz
make-cc0e474118bad882d690b23698fede80c06f6ef1.tar.bz2
make-cc0e474118bad882d690b23698fede80c06f6ef1.zip
packaging: Initial packaging
Change-Id: I39405bca870eafdcb709e2f2f653de626a80ab16 Author: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'packaging/make-3.81-err-reporting.patch')
-rw-r--r--packaging/make-3.81-err-reporting.patch151
1 files changed, 151 insertions, 0 deletions
diff --git a/packaging/make-3.81-err-reporting.patch b/packaging/make-3.81-err-reporting.patch
new file mode 100644
index 0000000..bbab96d
--- /dev/null
+++ b/packaging/make-3.81-err-reporting.patch
@@ -0,0 +1,151 @@
+--- make-3.80/misc.c.jj 2002-09-12 18:15:58.000000000 -0400
++++ make-3.80/misc.c 2005-08-22 05:46:05.000000000 -0400
+@@ -311,17 +311,31 @@ strerror (errnum)
+ /* Print an error message from errno. */
+
++void
++perror_with_name_err (const char *str, const char *name, int errnum)
++{
++ error (NILF, _("%s%s: %s"), str, name, strerror (errnum));
++}
++
+ void
+ perror_with_name (const char *str, const char *name)
+ {
+- error (NILF, _("%s%s: %s"), str, name, strerror (errno));
++ perror_with_name_err (str, name, errno);
+ }
+
+ /* Print an error message from errno and exit. */
+
++void
++pfatal_with_name_err (const char *name, int errnum)
++{
++ fatal (NILF, _("%s: %s"), name, strerror (errnum));
++
++ /* NOTREACHED */
++}
++
+ void
+ pfatal_with_name (const char *name)
+ {
+- fatal (NILF, _("%s: %s"), name, strerror (errno));
++ pfatal_with_name_err (name, errno);
+
+ /* NOTREACHED */
+ }
+
+--- make-3.81/main.c.jj 2006-05-23 12:51:25.000000000 +0200
++++ make-3.81/main.c 2006-05-23 12:50:48.000000000 +0200
+@@ -1502,13 +1502,13 @@
+ strcat (template, DEFAULT_TMPFILE);
+ outfile = open_tmpfile (&stdin_nm, template);
+ if (outfile == 0)
+- pfatal_with_name (_("fopen (temporary file)"));
++ pfatal_with_name_err (_("fopen (temporary file)"), errno);
+ while (!feof (stdin) && ! ferror (stdin))
+ {
+ char buf[2048];
+ unsigned int n = fread (buf, 1, sizeof (buf), stdin);
+ if (n > 0 && fwrite (buf, 1, n, outfile) != n)
+- pfatal_with_name (_("fwrite (temporary file)"));
++ pfatal_with_name_err (_("fwrite (temporary file)"), errno);
+ }
+ (void) fclose (outfile);
+
+@@ -1681,7 +1681,7 @@
+ else if ((job_rfd = dup (job_fds[0])) < 0)
+ {
+ if (errno != EBADF)
+- pfatal_with_name (_("dup jobserver"));
++ pfatal_with_name_err (_("dup jobserver"), errno);
+
+ error (NILF,
+ _("warning: jobserver unavailable: using -j1. Add `+' to parent make rule."));
+@@ -1721,7 +1721,7 @@
+ char c = '+';
+
+ if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0)
+- pfatal_with_name (_("creating jobs pipe"));
++ pfatal_with_name_err (_("creating jobs pipe"), errno);
+
+ /* Every make assumes that it always has one job it can run. For the
+ submakes it's the token they were given by their parent. For the
+@@ -1736,7 +1736,7 @@
+
+ EINTRLOOP (r, write (job_fds[1], &c, 1));
+ if (r != 1)
+- pfatal_with_name (_("init jobserver pipe"));
++ pfatal_with_name_err (_("init jobserver pipe"), errno);
+ }
+
+ /* Fill in the jobserver_fds struct for our children. */
+@@ -2151,8 +2151,8 @@
+ /* If there is a temp file from reading a makefile from stdin, get rid of
+ it now. */
+ if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT)
+- perror_with_name (_("unlink (temporary file): "), stdin_nm);
++ perror_with_name_err (_("unlink (temporary file): "), stdin_nm, errno);
+
+ {
+ int status;
+
+--- make-3.81/make.h.jj 2006-05-23 12:54:45.000000000 +0200
++++ make-3.81/make.h 2006-05-23 12:55:00.000000000 +0200
+@@ -414,6 +414,8 @@
+ extern void log_working_directory PARAMS ((int));
+ extern void pfatal_with_name PARAMS ((const char *)) __attribute__ ((noreturn));
+ extern void perror_with_name PARAMS ((const char *, const char *));
++extern void pfatal_with_name_err PARAMS ((const char *, int errnum)) __attribute__ ((noreturn));
++extern void perror_with_name_err PARAMS ((const char *, const char *, int errnum));
+ extern char *savestring PARAMS ((const char *, unsigned int));
+ extern char *concat PARAMS ((const char *, const char *, const char *));
+ extern char *xmalloc PARAMS ((unsigned int));
+
+--- make-3.81/job.c.jj 2006-05-23 13:01:35.000000000 +0200
++++ make-3.81/job.c 2006-05-23 13:50:44.000000000 +0200
+@@ -859,7 +859,7 @@
+
+ EINTRLOOP (r, write (job_fds[1], &token, 1));
+ if (r != 1)
+- pfatal_with_name (_("write jobserver"));
++ pfatal_with_name_err (_("write jobserver"), errno);
+
+ DB (DB_JOBS, (_("Released token for child 0x%08lx (%s).\n"),
+ (unsigned long int) child, child->file->name));
+@@ -1699,6 +1699,7 @@
+
+ /* Set interruptible system calls, and read() for a job token. */
+ set_child_handler_action_flags (1, waiting_jobs != NULL);
++ errno = 0;
+ got_token = read (job_rfd, &token, 1);
+ saved_errno = errno;
+ set_child_handler_action_flags (0, waiting_jobs != NULL);
+@@ -1713,10 +1714,14 @@
+
+ /* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise,
+ go back and reap_children(), and try again. */
+- errno = saved_errno;
+- if (errno != EINTR && errno != EBADF)
+- pfatal_with_name (_("read jobs pipe"));
+- if (errno == EBADF)
++ if (saved_errno != EINTR && saved_errno != EBADF)
++ {
++ if (got_token == 0)
++ fatal (NILF, _("read jobs pipe EOF"));
++ else
++ pfatal_with_name_err (_("read jobs pipe"), saved_errno);
++ }
++ if (saved_errno == EBADF)
+ DB (DB_JOBS, ("Read returned EBADF.\n"));
+ }
+ #endif
+@@ -1831,7 +1836,7 @@
+ error (NILF,
+ _("cannot enforce load limits on this operating system"));
+ else
+- perror_with_name (_("cannot enforce load limit: "), "getloadavg");
++ perror_with_name_err (_("cannot enforce load limit: "), "getloadavg", errno);
+ }
+ lossage = errno;
+ load = 0;