aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tinfo/write_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/ncurses/tinfo/write_entry.c')
-rw-r--r--contrib/ncurses/ncurses/tinfo/write_entry.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/write_entry.c b/contrib/ncurses/ncurses/tinfo/write_entry.c
index af4b4fda2a3a..ffcf4027f055 100644
--- a/contrib/ncurses/ncurses/tinfo/write_entry.c
+++ b/contrib/ncurses/ncurses/tinfo/write_entry.c
@@ -52,7 +52,7 @@
#define TRACE_OUT(p) /*nothing */
#endif
-MODULE_ID("$Id: write_entry.c,v 1.53 2000/10/04 02:32:14 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.56 2000/12/10 02:55:08 tom Exp $")
static int total_written;
@@ -109,7 +109,7 @@ make_directory(const char *path)
return rc;
}
-void
+NCURSES_EXPORT(void)
_nc_set_writedir(char *dir)
/* set the write directory for compiled entries */
{
@@ -117,7 +117,7 @@ _nc_set_writedir(char *dir)
char actual[PATH_MAX];
if (dir == 0
- && use_terminfo_vars())
+ && use_terminfo_vars())
dir = getenv("TERMINFO");
if (dir != 0)
@@ -131,7 +131,7 @@ _nc_set_writedir(char *dir)
destination = home;
if (make_directory(destination) < 0)
_nc_err_abort("%s: permission denied (errno %d)",
- destination, errno);
+ destination, errno);
}
}
@@ -164,7 +164,7 @@ check_writeable(int code)
static bool verified[sizeof(dirnames)];
char dir[2];
- char *s;
+ char *s = 0;
if (code == 0 || (s = strchr(dirnames, code)) == 0)
_nc_err_abort("Illegal terminfo subdirectory \"%c\"", code);
@@ -275,7 +275,7 @@ _nc_write_entry(TERMTYPE * const tp)
if (stat(filename, &statbuf) < 0
|| (start_time = statbuf.st_mtime) == 0) {
_nc_syserr_abort("error obtaining time from %s/%s",
- _nc_tic_dir(0), filename);
+ _nc_tic_dir(0), filename);
}
}
while (*other_names != '\0') {
@@ -301,7 +301,7 @@ _nc_write_entry(TERMTYPE * const tp)
if (strcmp(filename, linkname) == 0) {
_nc_warning("self-synonym ignored");
} else if (stat(linkname, &statbuf) >= 0 &&
- statbuf.st_mtime < start_time) {
+ statbuf.st_mtime < start_time) {
_nc_warning("alias %s multiply defined.", ptr);
} else if (_nc_access(linkname, W_OK) == 0)
#if HAVE_LINK
@@ -333,10 +333,16 @@ _nc_write_entry(TERMTYPE * const tp)
*/
if (code == 0 && errno == EEXIST)
_nc_warning("can't link %s to %s", filename, linkname);
- else if (code == 0 && errno == EPERM)
+ else if (code == 0 && (errno == EPERM || errno == ENOENT))
write_file(linkname, tp);
- else
+ else {
+#if MIXEDCASE_FILENAMES
_nc_syserr_abort("can't link %s to %s", filename, linkname);
+#else
+ _nc_warning("can't link %s to %s (errno=%d)", filename,
+ linkname, errno);
+#endif
+ }
} else {
DEBUG(1, ("Linked %s", linkname));
}
@@ -520,7 +526,7 @@ write_object(FILE * fp, TERMTYPE * tp)
TRACE_OUT(("WRITE %d booleans @%ld", tp->ext_Booleans, ftell(fp)));
if (tp->ext_Booleans
&& fwrite(tp->Booleans + BOOLCOUNT, sizeof(char),
- tp->ext_Booleans, fp) != tp->ext_Booleans)
+ tp->ext_Booleans, fp) != tp->ext_Booleans)
return (ERR);
if (even_boundary(tp->ext_Booleans))
@@ -549,7 +555,7 @@ write_object(FILE * fp, TERMTYPE * tp)
for (i = 0; i < tp->ext_Strings; i++) {
if (VALID_STRING(tp->Strings[i + STRCOUNT])) {
TRACE_OUT(("WRITE ext_Strings[%d]=%s", i,
- _nc_visbuf(tp->Strings[i + STRCOUNT])));
+ _nc_visbuf(tp->Strings[i + STRCOUNT])));
if (!WRITE_STRING(tp->Strings[i + STRCOUNT]))
return (ERR);
}
@@ -574,7 +580,7 @@ write_object(FILE * fp, TERMTYPE * tp)
/*
* Returns the total number of entries written by this process
*/
-int
+NCURSES_EXPORT(int)
_nc_tic_written(void)
{
return total_written;