summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-06-30 02:31:13 +0000
committerIgor Pashev <pashev.igor@gmail.com>2012-06-30 02:40:02 +0000
commitd20e6398e288393720f762d011dc332cf2262fd7 (patch)
tree15e1178bbe2f05d550b51ba8b4c61627243fc09b
parentb1c201156117c01a64e893fd5a69a5dd044ed09d (diff)
downloadsunmake-d20e6398e288393720f762d011dc332cf2262fd7.tar.gz
Ported to modern libc
-rw-r--r--usr/src/make_src/Make/bin/make/common/implicit.cc1
-rw-r--r--usr/src/make_src/Make/bin/make/common/nse_printdep.cc1
-rw-r--r--usr/src/make_src/Make/bin/make/common/read.cc2
-rw-r--r--usr/src/make_src/Make/bin/make/common/read2.cc2
-rw-r--r--usr/src/make_src/Make/bin/make/common/rep.cc12
-rw-r--r--usr/src/make_src/Make/lib/mksh/src/misc.cc26
-rw-r--r--usr/src/make_src/Make/lib/vroot/src/lock.cc19
7 files changed, 8 insertions, 55 deletions
diff --git a/usr/src/make_src/Make/bin/make/common/implicit.cc b/usr/src/make_src/Make/bin/make/common/implicit.cc
index a9b2f1d..5a6d1c0 100644
--- a/usr/src/make_src/Make/bin/make/common/implicit.cc
+++ b/usr/src/make_src/Make/bin/make/common/implicit.cc
@@ -96,7 +96,6 @@ extern void add_target_to_chain(Name target, Chain * query);
* recursion_level Used for tracing
*/
-extern int printf (const char *, ...);
static Boolean actual_doname = false;
diff --git a/usr/src/make_src/Make/bin/make/common/nse_printdep.cc b/usr/src/make_src/Make/bin/make/common/nse_printdep.cc
index cda02f8..8b8785a 100644
--- a/usr/src/make_src/Make/bin/make/common/nse_printdep.cc
+++ b/usr/src/make_src/Make/bin/make/common/nse_printdep.cc
@@ -49,7 +49,6 @@ static void print_rule(register Name target);
static void print_rec_info(Name target);
static Boolean is_out_of_date(Property line);
extern void depvar_print_results (void);
-extern int printf (const char *, ...);
extern int _flsbuf (unsigned int, FILE *);
/*
diff --git a/usr/src/make_src/Make/bin/make/common/read.cc b/usr/src/make_src/Make/bin/make/common/read.cc
index 586d609..74bccfd 100644
--- a/usr/src/make_src/Make/bin/make/common/read.cc
+++ b/usr/src/make_src/Make/bin/make/common/read.cc
@@ -395,7 +395,7 @@ read_simple_file(register Name makefile_name, register Boolean chase_path, regis
stdin_text_p = getmem(length = 1024);
stdin_buffer_end = stdin_text_p + length;
MBSTOWCS(wcs_buffer, NOCATGETS("standard input"));
- file_being_read = (wchar_t *) wsdup(wcs_buffer);
+ file_being_read = (wchar_t *) wcsdup(wcs_buffer);
line_number = 0;
while ((n = read(fileno(stdin),
stdin_text_p,
diff --git a/usr/src/make_src/Make/bin/make/common/read2.cc b/usr/src/make_src/Make/bin/make/common/read2.cc
index e1a9e1f..dd38359 100644
--- a/usr/src/make_src/Make/bin/make/common/read2.cc
+++ b/usr/src/make_src/Make/bin/make/common/read2.cc
@@ -1605,7 +1605,7 @@ make_relative(wchar_t *to, wchar_t *result)
}
MBSTOWCS(wcs_buffer, get_current_path());
- from = allocated = (wchar_t *) wsdup(wcs_buffer);
+ from = allocated = (wchar_t *) wcsdup(wcs_buffer);
/*
* Find the number of components in the from name.
diff --git a/usr/src/make_src/Make/bin/make/common/rep.cc b/usr/src/make_src/Make/bin/make/common/rep.cc
index 6ad4007..d6b35f9 100644
--- a/usr/src/make_src/Make/bin/make/common/rep.cc
+++ b/usr/src/make_src/Make/bin/make/common/rep.cc
@@ -141,16 +141,16 @@ report_recursive_init(void)
/*
* set conditional_macro_string if string is present
*/
- rp->oldline = (wchar_t *) wsdup(line);
+ rp->oldline = (wchar_t *) wcsdup(line);
if ( dollar != NULL ){
rp->cond_macrostring =
- (wchar_t *) wsdup(dollar - VER_LEN + 1);
+ (wchar_t *) wcsdup(dollar - VER_LEN + 1);
}
/*
* get target name into recursive struct
*/
*colon = (int) nul_char;
- rp->target = (wchar_t *) wsdup(line);
+ rp->target = (wchar_t *) wcsdup(line);
*bpatch = rp;
bpatch = &rp->next;
}
@@ -188,14 +188,14 @@ report_recursive_dep(Name target, wchar_t *line)
(void) memset((char *) rp, 0, sizeof (Recursive_make_rec));
wchar_t * wcb = get_wstring(target->string_mb); // XXX Tolik: needs retmem
rp->target = wcb;
- rp->newline = (wchar_t *) wsdup(line);
- rp->cond_macrostring = (wchar_t *) wsdup(rec_buf);
+ rp->newline = (wchar_t *) wcsdup(line);
+ rp->cond_macrostring = (wchar_t *) wcsdup(rec_buf);
*bpatch = rp;
bpatch = &rp->next;
changed = true;
} else {
if ((rp->oldline != NULL) && !IS_WEQUAL(rp->oldline, line)) {
- rp->newline = (wchar_t *) wsdup(line);
+ rp->newline = (wchar_t *) wcsdup(line);
changed = true;
}
rp->removed = false;
diff --git a/usr/src/make_src/Make/lib/mksh/src/misc.cc b/usr/src/make_src/Make/lib/mksh/src/misc.cc
index 17a878b..1f0c182 100644
--- a/usr/src/make_src/Make/lib/mksh/src/misc.cc
+++ b/usr/src/make_src/Make/lib/mksh/src/misc.cc
@@ -371,37 +371,11 @@ setup_char_semantics(void)
* Parameters:
* errnum The number of the error we want to describe
*
- * Global variables used:
- * sys_errlist A vector of error messages
- * sys_nerr The size of sys_errlist
*/
char *
errmsg(int errnum)
{
-#ifdef linux
return strerror(errnum);
-#else // linux
-
- extern int sys_nerr;
-#ifdef SUN4_x
- extern char *sys_errlist[];
-#endif
- char *errbuf;
-
- if ((errnum < 0) || (errnum > sys_nerr)) {
- errbuf = getmem(6+1+11+1);
- (void) sprintf(errbuf, catgets(libmksdmsi18n_catd, 1, 127, "Error %d"), errnum);
- return errbuf;
- } else {
-#ifdef SUN4_x
- return(sys_errlist[errnum]);
-#endif
-#ifdef SUN5_0
- return strerror(errnum);
-#endif
-
- }
-#endif // linux
}
static char static_buf[MAXPATHLEN*3];
diff --git a/usr/src/make_src/Make/lib/vroot/src/lock.cc b/usr/src/make_src/Make/lib/vroot/src/lock.cc
index c49a980..1e95643 100644
--- a/usr/src/make_src/Make/lib/vroot/src/lock.cc
+++ b/usr/src/make_src/Make/lib/vroot/src/lock.cc
@@ -42,11 +42,6 @@
#include <signal.h>
#include <errno.h> /* errno */
-#if !defined(linux)
-extern char *sys_errlist[];
-extern int sys_nerr;
-#endif
-
static void file_lock_error(char *msg, char *file, char *str, char* arg1, char* arg2);
#define BLOCK_INTERUPTS sigfillset(&newset) ; \
@@ -177,20 +172,6 @@ file_lock_error(char *msg, char *file, char *str, char* arg1, char* arg2)
len = strlen(msg);
sprintf(&msg[len], str, arg1, arg2);
strcat(msg, catgets(libmksdmsi18n_catd, 1, 146, " failed - "));
-#if !defined(linux)
- if (errno < sys_nerr) {
-#ifdef SUN4_x
- strcat(msg, sys_errlist[errno]);
-#endif
-#ifdef SUN5_0
- strcat(msg, strerror(errno));
-#endif
- } else {
- len = strlen(msg);
- sprintf(&msg[len], NOCATGETS("errno %d"), errno);
- }
-#else
strcat(msg, strerror(errno));
-#endif
}