diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2021-10-20 23:22:45 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2021-10-20 23:22:45 +0000 |
commit | 332fa27640b1901ac632e6d37a4aa9643d0f8594 (patch) | |
tree | bfb5303e24d1cd4ddd22df12f45a013fefb9ca23 /ncurses/tinfo/write_entry.c | |
parent | ff448436b2b70771d09b8d5ff34a509dcf02f81b (diff) | |
download | ncurses-332fa27640b1901ac632e6d37a4aa9643d0f8594.tar.gz |
ncurses-6.3HEADncurses-6.3master
Diffstat (limited to 'ncurses/tinfo/write_entry.c')
-rw-r--r-- | ncurses/tinfo/write_entry.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 1385176..cab4757 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -51,7 +51,7 @@ #define TRACE_NUM(n) /* nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.115 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.118 2021/08/15 20:07:11 tom Exp $") static int total_written; static int total_parts; @@ -71,7 +71,7 @@ write_file(char *filename, TERMTYPE2 *tp) _nc_warning("entry is larger than %u bytes", limit); } else { FILE *fp = ((_nc_access(filename, W_OK) == 0) - ? fopen(filename, BIN_W) + ? safe_fopen(filename, BIN_W) : 0); size_t actual; @@ -190,9 +190,9 @@ make_db_root(const char *path) #else struct stat statbuf; - if ((rc = stat(path, &statbuf)) < 0) { + if ((rc = stat(path, &statbuf)) == -1) { rc = mkdir(path -#if !defined(_WIN32) +#ifndef _NC_WINDOWS ,0777 #endif ); @@ -442,7 +442,7 @@ _nc_write_entry(TERMTYPE2 *const tp) write_file(filename, tp); if (start_time == 0) { - if (stat(filename, &statbuf) < 0 + if (stat(filename, &statbuf) == -1 || (start_time = statbuf.st_mtime) == 0) { _nc_syserr_abort("error obtaining time from %s/%s", _nc_tic_dir(0), filename); |