chiark / gitweb /
Use correct errno value for error writing to new .main during compact.
[chiark-tcl.git] / cdb / writeable.c
index 0df1b2799ae55a59e60672c23e99fe56f97304aa..9eefb2289ee795fcb320636b4ccb775fd0f7585e 100644 (file)
@@ -701,7 +701,7 @@ static int compact_core(Tcl_Interp *ip, Rw *rw, unsigned long logsz,
   if (!a.mainfile) PE("create .tmp for new main during compact");
 
   r= ht_forall(&rw->logincore, addto_main, &a);
-  if (r) { rc= cht_posixerr(ip, r, "error writing to new .main"
+  if (r) { rc= cht_posixerr(ip, errno, "error writing to new .main"
                            " during compact");  goto x_rc; }
 
   r= putc('\n', a.mainfile);