X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fwrite_entry.c;h=cab4757019730a01838f1254aabe92f862267b9a;hp=763ddd72d82e468a41e7556c589e4d1e586f43a1;hb=c0e5fbfcce224693b3effdd295ee49b6b761b754;hpb=81304798ee736c467839c779c9ca5dca48db7bea diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 763ddd72..cab47570 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -51,7 +51,7 @@ #define TRACE_NUM(n) /* nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.117 2021/06/26 20:43:19 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; @@ -190,7 +190,7 @@ 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 #ifndef _NC_WINDOWS ,0777 @@ -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);