follow-up

This commit is contained in:
nhmall
2025-05-30 10:00:42 -04:00
parent 8a2b8796cd
commit 1bf92496f4
+2 -6
View File
@@ -849,14 +849,13 @@ create_bonesfile(d_level *lev, char **bonesid, char errbuf[])
failed = errno; failed = errno;
} }
if (nhfp->structlevel) { if (nhfp->structlevel) {
#ifndef UNIX
#if defined(MICRO) || defined(WIN32) #if defined(MICRO) || defined(WIN32)
/* Use O_TRUNC to force the file to be shortened if it already /* Use O_TRUNC to force the file to be shortened if it already
* exists and is currently longer. * exists and is currently longer.
*/ */
nhfp->fd = open(file, nhfp->fd = open(file,
O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, FCMASK); O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, FCMASK);
#else #else /* ?MICRO || WIN32 */
/* implies UNIX or MAC (MAC is for OS9 or earlier) */ /* implies UNIX or MAC (MAC is for OS9 or earlier) */
#ifdef MAC #ifdef MAC
nhfp->fd = maccreat(file, BONE_TYPE); nhfp->fd = maccreat(file, BONE_TYPE);
@@ -864,7 +863,6 @@ create_bonesfile(d_level *lev, char **bonesid, char errbuf[])
nhfp->fd = creat(file, FCMASK); nhfp->fd = creat(file, FCMASK);
#endif /* ?MAC */ #endif /* ?MAC */
#endif /* ?MICRO || WIN32 */ #endif /* ?MICRO || WIN32 */
#endif /* UNIX */
if (nhfp->fd < 0) if (nhfp->fd < 0)
failed = errno; failed = errno;
#if defined(MSDOS) #if defined(MSDOS)
@@ -1150,7 +1148,6 @@ create_savefile(void)
#ifdef SAVEFILE_DEBUGGING #ifdef SAVEFILE_DEBUGGING
nhfp->fplog = fopen("create-savefile.log", "w"); nhfp->fplog = fopen("create-savefile.log", "w");
#endif #endif
#ifndef UNIX
#if defined(MICRO) || defined(WIN32) #if defined(MICRO) || defined(WIN32)
nhfp->fd = open(fq_save, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, nhfp->fd = open(fq_save, O_WRONLY | O_BINARY | O_CREAT | O_TRUNC,
FCMASK); FCMASK);
@@ -1162,12 +1159,11 @@ create_savefile(void)
nhfp->fd = creat(fq_save, FCMASK); nhfp->fd = creat(fq_save, FCMASK);
#endif #endif
#endif /* MICRO || WIN32 */ #endif /* MICRO || WIN32 */
}
#if defined(MSDOS) || defined(WIN32) #if defined(MSDOS) || defined(WIN32)
if (nhfp->fd >= 0) if (nhfp->fd >= 0)
(void) setmode(nhfp->fd, O_BINARY); (void) setmode(nhfp->fd, O_BINARY);
#endif #endif
#endif /* UNIX */ }
} }
#if defined(VMS) && !defined(SECURE) #if defined(VMS) && !defined(SECURE)
/* /*